Corrections sur les dates affichées

This commit is contained in:
Martin Pépin 2016-09-10 19:15:43 +02:00
parent 7d02f29e48
commit ae3ef21a2f

View file

@ -32,7 +32,8 @@ class Tirage(models.Model):
default=False) default=False)
def date_no_seconds(self): 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): def __str__(self):
return "%s - %s" % (self.title, self.date_no_seconds()) return "%s - %s" % (self.title, self.date_no_seconds())
@ -89,7 +90,8 @@ class Spectacle(models.Model):
return "%d" % calendar.timegm(self.date.utctimetuple()) return "%d" % calendar.timegm(self.date.utctimetuple())
def date_no_seconds(self): 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): def __str__(self):
return "%s - %s, %s, %.02f" % (self.title, self.date_no_seconds(), return "%s - %s, %s, %.02f" % (self.title, self.date_no_seconds(),