From ae3ef21a2f9dbfbc55857f8db8ea2f5df61c58f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 10 Sep 2016 19:15:43 +0200 Subject: [PATCH] =?UTF-8?q?Corrections=20sur=20les=20dates=20affich=C3=A9e?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bda/models.py b/bda/models.py index 8a7d0814..270921be 100644 --- a/bda/models.py +++ b/bda/models.py @@ -32,7 +32,8 @@ class Tirage(models.Model): default=False) def date_no_seconds(self): - return self.fermeture.strftime('%d %b %Y %H:%M') + return self.fermeture.astimezone(timezone.get_current_timezone()) \ + .strftime('%d %b %Y %H:%M') def __str__(self): return "%s - %s" % (self.title, self.date_no_seconds()) @@ -89,7 +90,8 @@ class Spectacle(models.Model): return "%d" % calendar.timegm(self.date.utctimetuple()) def date_no_seconds(self): - return self.date.strftime('%d %b %Y %H:%M') + return self.date.astimezone(timezone.get_current_timezone()) \ + .strftime('%d %b %Y %H:%M') def __str__(self): return "%s - %s, %s, %.02f€" % (self.title, self.date_no_seconds(),