mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed timezone bug
This commit is contained in:
parent
667c567df0
commit
86d20cc0a8
@ -47,6 +47,7 @@ class expandeddate(datetime.date):
|
|||||||
cal = tomorrow.isocalendar()
|
cal = tomorrow.isocalendar()
|
||||||
return (cal[0],cal[1],cal[2] % 7)
|
return (cal[0],cal[1],cal[2] % 7)
|
||||||
|
|
||||||
|
|
||||||
date = expandeddate
|
date = expandeddate
|
||||||
|
|
||||||
|
|
||||||
@ -612,17 +613,18 @@ def ranges(since=None,to=None,within=None,timerange=None,step="month",stepn=1,tr
|
|||||||
|
|
||||||
|
|
||||||
def today():
|
def today():
|
||||||
tod = date.today()
|
tod = datetime.datetime.utcnow()
|
||||||
return MTime(tod.year,tod.month,tod.day)
|
return MTime(tod.year,tod.month,tod.day)
|
||||||
def thisweek():
|
def thisweek():
|
||||||
tod = date.today()
|
tod = datetime.datetime.utcnow()
|
||||||
|
tod = 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 = date.today()
|
tod = datetime.datetime.utcnow()
|
||||||
return MTime(tod.year,tod.month)
|
return MTime(tod.year,tod.month)
|
||||||
def thisyear():
|
def thisyear():
|
||||||
tod = date.today()
|
tod = datetime.datetime.utcnow()
|
||||||
return MTime(tod.year)
|
return MTime(tod.year)
|
||||||
|
|
||||||
#def _get_start_of(timestamp,unit):
|
#def _get_start_of(timestamp,unit):
|
||||||
|
Loading…
Reference in New Issue
Block a user