Added two new methods to TimeSlot: local_start_time() and local_end_time().
- Legacy-Id: 17682
This commit is contained in:
parent
2e1e2b7ad1
commit
788321dbf3
|
@ -532,6 +532,18 @@ class TimeSlot(models.Model):
|
|||
return local_end_time.astimezone(pytz.utc)
|
||||
else:
|
||||
return None
|
||||
def local_start_time(self):
|
||||
if self.tz():
|
||||
local_start_time = self.tz().localize(self.time)
|
||||
return local_start_time
|
||||
else:
|
||||
return None
|
||||
def local_end_time(self):
|
||||
if self.tz():
|
||||
local_end_time = self.tz().localize(self.end_time())
|
||||
return local_end_time
|
||||
else:
|
||||
return None
|
||||
|
||||
@property
|
||||
def js_identifier(self):
|
||||
|
|
Loading…
Reference in a new issue