You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running my test suite this morning revealed that the "yesterday" option of the DateRangeFilter fails on January 1.
This happens because today's year is extracted rather than yesterday's year to generate the queryset filter parameter. Given that today is Jan 1, 2018, the date of Dec 31, 2018 is used rather than Dec 31, 2017.
Generated SQL: WHERE (my_date_field BETWEEN 2018-01-01 AND 2018-12-31 AND EXTRACT(MONTH FROM my_date_field) = 1 AND EXTRACT(DAY FROM my_date_field) = 31)'
Happy new year!
Running my test suite this morning revealed that the "yesterday" option of the DateRangeFilter fails on January 1.
This happens because today's year is extracted rather than yesterday's year to generate the queryset filter parameter. Given that today is Jan 1, 2018, the date of Dec 31, 2018 is used rather than Dec 31, 2017.
django-filter/django_filters/filters.py
Lines 446 to 449 in 553c9ea
Generated SQL:
WHERE (my_date_field BETWEEN 2018-01-01 AND 2018-12-31 AND EXTRACT(MONTH FROM my_date_field) = 1 AND EXTRACT(DAY FROM my_date_field) = 31)'
This appears to fix:
PR to follow.
The text was updated successfully, but these errors were encountered: