mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Adjusted predefined ranges to consider timezone
This commit is contained in:
parent
951f6bb562
commit
e6535eb6bc
@ -383,18 +383,18 @@ y = MTime(2020)
|
|||||||
|
|
||||||
|
|
||||||
def today():
|
def today():
|
||||||
tod = datetime.datetime.utcnow()
|
tod = datetime.datetime.now(tz=TIMEZONE)
|
||||||
return MTime(tod.year,tod.month,tod.day)
|
return MTime(tod.year,tod.month,tod.day)
|
||||||
def thisweek():
|
def thisweek():
|
||||||
tod = datetime.datetime.utcnow()
|
tod = datetime.datetime.now(tz=TIMEZONE)
|
||||||
tod = datetime.date(tod.year,tod.month,tod.day)
|
tod = datetime.date(tod.year,tod.month,tod.day)
|
||||||
y,w,_ = tod.chrcalendar()
|
y,w,_ = tod.chrcalendar()
|
||||||
return MTimeWeek(y,w)
|
return MTimeWeek(y,w)
|
||||||
def thismonth():
|
def thismonth():
|
||||||
tod = datetime.datetime.utcnow()
|
tod = datetime.datetime.now(tz=TIMEZONE)
|
||||||
return MTime(tod.year,tod.month)
|
return MTime(tod.year,tod.month)
|
||||||
def thisyear():
|
def thisyear():
|
||||||
tod = datetime.datetime.utcnow()
|
tod = datetime.datetime.now(tz=TIMEZONE)
|
||||||
return MTime(tod.year)
|
return MTime(tod.year)
|
||||||
def alltime():
|
def alltime():
|
||||||
return MRange(None,None)
|
return MRange(None,None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user