mirror of
https://github.com/krateng/maloja.git
synced 2025-04-22 19:40:28 +03:00
This time for real tho
This commit is contained in:
parent
2a5d9498d1
commit
06c32e205e
@ -5,7 +5,7 @@ author = {
|
||||
"email":"maloja@krateng.dev",
|
||||
"github": "krateng"
|
||||
}
|
||||
version = 2,12,3
|
||||
version = 2,12,4
|
||||
versionstr = ".".join(str(n) for n in version)
|
||||
links = {
|
||||
"pypi":"malojaserver",
|
||||
|
@ -205,9 +205,12 @@ class MTime(MRangeDescriptor):
|
||||
class MTimeWeek(MRangeDescriptor):
|
||||
def __init__(self,year=None,week=None):
|
||||
|
||||
# do this so we can construct the week with overflow (eg 2020/-3)
|
||||
thisisoyear_firstday = datetime.date.fromchrcalendar(year,1,1)
|
||||
self.firstday = thisisoyear_firstday + datetime.timedelta(days=7*(week-1))
|
||||
# do this so we can construct the week with overflow (eg 2020/-3)
|
||||
self.firstday = datetime.date(self.firstday.year,self.firstday.month,self.firstday.day)
|
||||
# for compatibility with pre python3.8 (https://bugs.python.org/issue32417)
|
||||
|
||||
|
||||
self.lastday = self.firstday + datetime.timedelta(days=6)
|
||||
|
||||
|
@ -50,7 +50,6 @@ class expandeddate(date):
|
||||
@classmethod
|
||||
def fromchrcalendar(cls,y,w,d):
|
||||
try:
|
||||
assert 1==2
|
||||
return datetime.date.fromisocalendar(y,w,d) - timedelta(days=1) #sunday instead of monday
|
||||
except:
|
||||
# pre python3.8 compatibility
|
||||
|
Loading…
x
Reference in New Issue
Block a user