Skip to content
Snippets Groups Projects
Verified Commit d02af8dc authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Fix from_date.

parent 1d968868
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ class CalendarWeek:
def from_date(cls, when: date):
""" Get the calendar week by a date object (the week this date is in). """
return cls(year=when.strftime('%Y'), week=when.strftime('%V'))
return cls(year=when.year, week=int(when.strftime('%V')))
def __post_init__(self) -> None:
today = date.today()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment