Skip to content
Snippets Groups Projects

Resolve "Problems with dates which are in the new year, but in the last calendar week of the old year"

All threads resolved!
@@ -68,8 +68,7 @@ class CalendarWeek:
@@ -68,8 +68,7 @@ class CalendarWeek:
if when.month == 12 and week == 1:
if when.month == 12 and week == 1:
year += 1
year += 1
elif when.month == 1 and (week == 52 or week == 53):
if (week == 52 or week == 53) and when.month == 1:
year -= 1
year -= 1
return cls(year=year, week=week)
return cls(year=year, week=week)
Loading