From d183b8b3447db2b3d94ec4f369e2980b2582d5b5 Mon Sep 17 00:00:00 2001 From: michel Date: Fri, 10 Nov 2017 17:09:59 +0100 Subject: [PATCH] ./ --- models/event.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/event.py b/models/event.py index 9e0293c..1c40d09 100644 --- a/models/event.py +++ b/models/event.py @@ -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)