Calculate dates for at year
This commit is contained in:
parent
19852867df
commit
ef1e916b8a
13
datoer.py
Normal file
13
datoer.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import sys
|
||||
import calendar
|
||||
|
||||
year = 2024
|
||||
if len(sys.argv) > 1:
|
||||
try:
|
||||
year = int(sys.argv[-1])
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
for month in range(1, 13):
|
||||
last_sunday = max(week[-1] for week in calendar.monthcalendar(year, month))
|
||||
print('{}-{}-{:2}'.format(year, calendar.month_abbr[month], last_sunday))
|
Loading…
Reference in a new issue