do not include start hour in long string if it's midnight
This commit is contained in:
parent
db831555ad
commit
9bea4f0cc9
|
@ -39,7 +39,10 @@ class BaseEvent(Item):
|
||||||
def longdatetime(self):
|
def longdatetime(self):
|
||||||
# unfortunately this forces the locale
|
# unfortunately this forces the locale
|
||||||
formatter = locales.getLocale('fr').dates.getFormatter('dateTime', 'medium')
|
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)
|
return formatter.format(self.start)
|
||||||
longdatetime = property(longdatetime)
|
longdatetime = property(longdatetime)
|
||||||
|
|
||||||
|
|
Reference in New Issue