Ticket #4313: unicode-dateformat.diff
File unicode-dateformat.diff, 850 bytes (added by , 18 years ago) |
---|
-
utils/dateformat.py
13 13 14 14 from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS 15 15 from django.utils.tzinfo import LocalTimezone 16 from django.utils.encoding import smart_unicode 16 17 from django.utils.translation import ugettext as _ 17 18 from calendar import isleap, monthrange 18 19 import re, time … … 25 26 pieces = [] 26 27 for i, piece in enumerate(re_formatchars.split(formatstr)): 27 28 if i % 2: 28 pieces.append(s tr(getattr(self, piece)()))29 pieces.append(smart_unicode(getattr(self, piece)())) 29 30 elif piece: 30 31 pieces.append(re_escaped.sub(r'\1', piece)) 31 32 return u''.join(pieces)