Skip to content

Commit

Permalink
fix: 29th february in birthday list command
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 committed Jun 28, 2024
1 parent f6220cc commit bfb9eef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chouette/commands/birthdays.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ async def list(self, interaction: Interaction[ChouetteBot]) -> None:
birthdays[0][1].get("birthday").day == 29
and birthdays[0][1].get("birthday").month == 2
):
next_birthday = (
birthdays[0][1].get("birthday").replace(date.today().year + 1, 3, 1)
)
try:
next_birthday = date(date.today().year + 1, 2, 29)
except ValueError:
next_birthday = date(date.today().year + 1, 3, 1)
else:
next_birthday = birthdays[0][1].get("birthday").replace(date.today().year + 1)
msg += "```"
Expand Down

0 comments on commit bfb9eef

Please sign in to comment.