mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
10 lines
289 B
Python
10 lines
289 B
Python
import datetime
|
|
import sys
|
|
|
|
|
|
def date_fromisocalendar(isoyear, isoweek, isoday):
|
|
if sys.version_info < (3, 8):
|
|
return datetime.datetime.strptime(f'{isoyear}-W{isoweek}-{isoday}', "%G-W%V-%u")
|
|
else:
|
|
return datetime.datetime.fromisocalendar(isoyear, isoweek, isoday)
|