Ticket #12309: django-12309.diff

File django-12309.diff, 1.8 KB (added by shell_dweller, 15 years ago)

Just the code patch, without .po files

  • django/utils/dates.py

     
    3131    1:_('Jan.'), 2:_('Feb.'), 3:_('March'), 4:_('April'), 5:_('May'), 6:_('June'), 7:_('July'),
    3232    8:_('Aug.'), 9:_('Sept.'), 10:_('Oct.'), 11:_('Nov.'), 12:_('Dec.')
    3333}
     34MONTHS_ALTERNATIVE = { # required by some locales
     35    1:_('_January'), 2:_('_February'), 3:_('_March'), 4:_('_April'), 5:_('_May'), 6:_('_June'),
     36    7:_('_July'), 8:_('_August'), 9:_('_September'), 10:_('_October'), 11:_('_November'),
     37    12:_('_December')
     38}
     39 No newline at end of file
  • django/utils/dateformat.py

     
    1414import re
    1515import time
    1616import calendar
    17 from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS, WEEKDAYS_ABBR
     17from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS, WEEKDAYS_ABBR, MONTHS_ALTERNATIVE
    1818from django.utils.tzinfo import LocalTimezone
    1919from django.utils.translation import ugettext as _
    2020from django.utils.encoding import force_unicode
    2121
    22 re_formatchars = re.compile(r'(?<!\\)([aAbBdDfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
     22re_formatchars = re.compile(r'(?<!\\)([aAbBdDEfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
    2323re_escaped = re.compile(r'\\(.)')
    2424
    2525class Formatter(object):
     
    126126        "Day of the week, textual, 3 letters; e.g. 'Fri'"
    127127        return WEEKDAYS_ABBR[self.data.weekday()]
    128128
     129    def E(self):
     130        "Alternative month names as required by some locales"
     131        return MONTHS_ALTERNATIVE[self.data.month]
     132
    129133    def F(self):
    130134        "Month, textual, long; e.g. 'January'"
    131135        return MONTHS[self.data.month]
Back to Top