From 9bea4f0cc94f2fd7f0bda124f38b8234c478a098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 1 Dec 2011 20:49:56 +0100 Subject: [PATCH] do not include start hour in long string if it's midnight --- tabellio/agenda/event.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tabellio/agenda/event.py b/tabellio/agenda/event.py index 0ac66ee..ce73b85 100644 --- a/tabellio/agenda/event.py +++ b/tabellio/agenda/event.py @@ -39,7 +39,10 @@ class BaseEvent(Item): def longdatetime(self): # unfortunately this forces the locale formatter = locales.getLocale('fr').dates.getFormatter('dateTime', 'medium') - formatter.setPattern(u'EEEE d MMMM yyyy à HH:mm') + if self.start.hour == 0 and self.start.minute == 0: + formatter.setPattern(u'EEEE d MMMM yyyy') + else: + formatter.setPattern(u'EEEE d MMMM yyyy à HH:mm') return formatter.format(self.start) longdatetime = property(longdatetime)