Skip to content
Snippets Groups Projects

Resolve "Introduce function to get the last week of a year"

Merged Jonathan Weth requested to merge 6-introduce-function-to-get-the-last-week-of-a-year into master
1 file
+ 7
0
Compare changes
  • Side-by-side
  • Inline
@@ -94,6 +94,13 @@ class CalendarWeek:
@@ -94,6 +94,13 @@ class CalendarWeek:
return weeks
return weeks
 
@classmethod
 
def get_last_week_of_year(cls, year: int) -> CalendarWeek:
 
"""Get the last week of a year."""
 
 
last_week = date(year, 12, 28).isocalendar()[1]
 
return cls(week=last_week, year=year)
 
def __post_init__(self) -> None:
def __post_init__(self) -> None:
today = date.today()
today = date.today()
Loading