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
I would really appreciate if this could be looked into by the maintainers. For me this is not just "strange behaviour" but a straight up bug. I would even go as far and argue that the input should be left as datetime.date and not turned into datetime.datetime. Even the official Django docs argue for not mixing dates and datetimes.
To specify why I classify this issue as bug:
Consider the input "2024-06-27" which is currently transformed to datetime value.start=datetime.datetime(2024, 8, 27, 0, 0, tzinfo=<current time zone>).
In a query, field_name__range=(value.start, value.end) includes instances with field_name = datetime.date(2024, 08, 26) (one day before).
This does not happen when removing either timezones as done in #1660 or leaving the inputs as date.
Dates in Django do not have timezones, as they are just dates, only DateTime has this, which makes sence.
Here we make DateRangeField timezone aware:
django-filter/django_filters/fields.py
Line 42 in 920a79f
Why is that? It's causing really strange behaviour.
And when removing the timezone code for this, all is good with any timezone i try.
The text was updated successfully, but these errors were encountered: