def test_month_utilities(self): # test the month names of certain locales months = localdatetime.get_month_names(locale='nl') self.assertEquals([u'januari', u'februari', u'maart', u'april', u'mei', u'juni', u'juli', u'augustus', u'september', u'oktober', u'november', u'december'], months) monthabbrs = localdatetime.get_month_abbreviations(locale='nl') self.assertEquals([u'jan', u'feb', u'mrt', u'apr', u'mei', u'jun', u'jul', u'aug', u'sep', u'okt', u'nov', u'dec'], monthabbrs)
def publication_date(self): date = self.content.get_display_datetime() if not date: date = getUtility(IMetadataService).getMetadataValue( self.content, 'silva-extra', 'publicationtime') if date: if not isinstance(date, datetime): date = date.asdatetime() local_months = localdatetime.get_month_names(self.request) return u'%s.%s.%s, %s:%s' % (date.day, local_months[date.month-1], date.year, '%02d' % (date.hour), '%02d' % (date.minute)) return u''
def month_names(self): return localdatetime.get_month_names(self.request)