Ticket #2998: dateformat.py.diff
File dateformat.py.diff, 1.2 KB (added by , 18 years ago) |
---|
-
django/utils/dateformat.py
11 11 >>> 12 12 """ 13 13 14 from django.utils.translation import gettext_lazy as _ 14 15 from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS 15 16 from django.utils.tzinfo import LocalTimezone 16 17 from calendar import isleap, monthrange … … 36 37 def a(self): 37 38 "'a.m.' or 'p.m.'" 38 39 if self.data.hour > 11: 39 return 'p.m.'40 return 'a.m.'40 return _('p.m.') 41 return _('a.m.') 41 42 42 43 def A(self): 43 44 "'AM' or 'PM'" 44 45 if self.data.hour > 11: 45 return 'PM'46 return 'AM'46 return _('PM') 47 return _('AM') 47 48 48 49 def B(self): 49 50 "Swatch Internet time" … … 91 92 Proprietary extension. 92 93 """ 93 94 if self.data.minute == 0 and self.data.hour == 0: 94 return 'midnight'95 return _('midnight') 95 96 if self.data.minute == 0 and self.data.hour == 12: 96 return 'noon'97 return _('noon') 97 98 return '%s %s' % (self.f(), self.a()) 98 99 99 100 def s(self):