mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +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",
|
"email":"maloja@krateng.dev",
|
||||||
"github": "krateng"
|
"github": "krateng"
|
||||||
}
|
}
|
||||||
version = 2,12,3
|
version = 2,12,4
|
||||||
versionstr = ".".join(str(n) for n in version)
|
versionstr = ".".join(str(n) for n in version)
|
||||||
links = {
|
links = {
|
||||||
"pypi":"malojaserver",
|
"pypi":"malojaserver",
|
||||||
|
@ -205,9 +205,12 @@ class MTime(MRangeDescriptor):
|
|||||||
class MTimeWeek(MRangeDescriptor):
|
class MTimeWeek(MRangeDescriptor):
|
||||||
def __init__(self,year=None,week=None):
|
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)
|
thisisoyear_firstday = datetime.date.fromchrcalendar(year,1,1)
|
||||||
self.firstday = thisisoyear_firstday + datetime.timedelta(days=7*(week-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)
|
self.lastday = self.firstday + datetime.timedelta(days=6)
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@ class expandeddate(date):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def fromchrcalendar(cls,y,w,d):
|
def fromchrcalendar(cls,y,w,d):
|
||||||
try:
|
try:
|
||||||
assert 1==2
|
|
||||||
return datetime.date.fromisocalendar(y,w,d) - timedelta(days=1) #sunday instead of monday
|
return datetime.date.fromisocalendar(y,w,d) - timedelta(days=1) #sunday instead of monday
|
||||||
except:
|
except:
|
||||||
# pre python3.8 compatibility
|
# pre python3.8 compatibility
|
||||||
|
Loading…
x
Reference in New Issue
Block a user