./
This commit is contained in:
parent
4c687fb6a5
commit
d183b8b344
@ -31,7 +31,9 @@ class Event(models.Model):
|
||||
def _compute_duration(self):
|
||||
for event in self:
|
||||
if event.duration is True:
|
||||
fmt = '%Y-%m-%d'
|
||||
t1 = fields.Datetime.from_string(event.date_end)
|
||||
t2 = fields.Datetime.from_string(event.date_start)
|
||||
d1 = datetime.strptime(t1, fmt)
|
||||
d2 = datetime.strptime(t2, fmt)
|
||||
daysDiff = str((d2-d1).day)
|
||||
|
Loading…
Reference in New Issue
Block a user