Change cutoff months for rollover.
This commit is contained in:
@@ -48,10 +48,10 @@ def get_datetime(day: str) -> datetime:
|
|||||||
day = int(day.split("/")[1])
|
day = int(day.split("/")[1])
|
||||||
|
|
||||||
# ensure that year rolls over if current month is December and the next month is less than 12.
|
# ensure that year rolls over if current month is December and the next month is less than 12.
|
||||||
if today.month == calendar.DECEMBER and month < calendar.DECEMBER:
|
if today.month == calendar.DECEMBER and month < calendar.OCTOBER:
|
||||||
year += 1
|
year += 1
|
||||||
|
|
||||||
if today.month == calendar.JANUARY and month > calendar.JANUARY:
|
if today.month == calendar.JANUARY and month > calendar.MARCH:
|
||||||
year -= 1
|
year -= 1
|
||||||
|
|
||||||
return datetime(year, month, day, tzinfo=UTC)
|
return datetime(year, month, day, tzinfo=UTC)
|
||||||
|
|||||||
Reference in New Issue
Block a user