mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed another time bug
This commit is contained in:
parent
f67f900dae
commit
6555eea887
@ -57,10 +57,10 @@ class expandeddate(date):
|
||||
firstdayofyear = datetime.date(y,1,1)
|
||||
wkday = firstdayofyear.isoweekday()
|
||||
if wkday <= 4: # day up to thursday -> this week belongs to the new year
|
||||
firstisodayofyear = firstdayofyear - timedelta(days=wkday) #this alos shifts to sunday first weeks
|
||||
firstisodayofyear = firstdayofyear - timedelta(days=wkday) #this also shifts to sunday-first weeks
|
||||
else: # if not, still old year
|
||||
firstisodayofyear = firstdayofyear + timedelta(days=7-wkday) #same
|
||||
return firstisodayofyear + timedelta(days=(w-1)*7) + timedelta(days=d)
|
||||
return firstisodayofyear + timedelta(days=(w-1)*7) + timedelta(days=d-1)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user