Skip to content

Commit

Permalink
Fix dates in the next year
Browse files Browse the repository at this point in the history
The line to push dates into the next year wasn't working, so I've rewritten it
  • Loading branch information
sysmoon14 authored and 5ila5 committed Dec 30, 2024
1 parent e00ab55 commit d067fa7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def trimsuffix(s):
date = today + timedelta(days=1)
else:
date = datetime.strptime(collectiondate, '%A, %d %B %Y').date()

# As no year is specified we might need to add one year if it crosses Dec 31st
if date < today:
date.replace(year = today.year + 1)
# As no year is specified we might need to add one year if it crosses Dec 31st
if date.month == 1 and today.month == 12:
date = date.replace(year=date.year+1)


entries.append(
Collection(
Expand Down

0 comments on commit d067fa7

Please sign in to comment.