﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31446	Annotate with ExpressionWrapper gives wrong result on date field	Gerben Morsink	nobody	"When doing:

{{{
from django.db.models import DateField, ExpressionWrapper, F

Ticket.objects.annotate(
    notify_date=ExpressionWrapper(
        F('date') - F('notify_before_in_days'), output_field=DateField()))
}}}
With on Ticket a modelfield: date =  models.DateField() will yield wrong results if notify_before_in_days passes through the month boundary.
E.g. If date is 9th of April and notify_before_in_days = 10, it will yield: 20200399 for notify_date, instead of 20200331.

Database is MySQL 8.0.19-0ubuntu0.19.10.3 - (Ubuntu), Django version is 2.2.10."	Bug	new	Database layer (models, ORM)	2.2	Normal				Unreviewed	0	0	0	0	0	0
