Skip to content

Commit 17e34c9

Browse files
committed
fix: update time-filtering for Django 5
Django 5 requires a date for DST-calculations, therefore use full datetime with timezone info. Refs: PT-1947
1 parent 93e628b commit 17e34c9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

common/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ def convert_to_localtime_tz(value):
100100
dt = datetime.combine(datetime.now().date(), value)
101101
if timezone.is_naive(value):
102102
# Auto add local timezone to naive time
103-
return timezone.make_aware(dt).timetz()
103+
return timezone.make_aware(dt)
104104
else:
105-
return timezone.localtime(dt).timetz()
105+
return timezone.localtime(dt)
106106

107107

108108
def to_local_datetime_if_naive(value) -> datetime:

0 commit comments

Comments
 (0)