1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Timeranges should now consider timezone

This commit is contained in:
Krateng 2020-12-01 19:12:20 +01:00
parent e475b0c716
commit 951f6bb562

View File

@ -182,10 +182,10 @@ class MTime(MRangeDescriptor):
def first_stamp(self):
day = self.first_day().dateobject
return int(datetime.datetime.combine(day,datetime.time(tzinfo=datetime.timezone.utc)).timestamp())
return int(datetime.datetime.combine(day,datetime.time(tzinfo=TIMEZONE)).timestamp())
def last_stamp(self):
day = self.last_day().dateobject + datetime.timedelta(days=1)
return int(datetime.datetime.combine(day,datetime.time(tzinfo=datetime.timezone.utc)).timestamp() - 1)
return int(datetime.datetime.combine(day,datetime.time(tzinfo=TIMEZONE)).timestamp() - 1)
# next range of equal length (not exactly same amount of days, but same precision level)
def next(self,step=1):