Ticket #4313: unicode-dateformat.diff

File unicode-dateformat.diff, 850 bytes (added by anonymous, 17 years ago)
  • utils/dateformat.py

     
    1313
    1414from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS
    1515from django.utils.tzinfo import LocalTimezone
     16from django.utils.encoding import smart_unicode
    1617from django.utils.translation import ugettext as _
    1718from calendar import isleap, monthrange
    1819import re, time
     
    2526        pieces = []
    2627        for i, piece in enumerate(re_formatchars.split(formatstr)):
    2728            if i % 2:
    28                 pieces.append(str(getattr(self, piece)()))
     29                pieces.append(smart_unicode(getattr(self, piece)()))
    2930            elif piece:
    3031                pieces.append(re_escaped.sub(r'\1', piece))
    3132        return u''.join(pieces)
Back to Top