Permalink
Browse files

unicode: Fixed #4313 -- fixed a problem with unicode strings and date…

…time

format filters.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5267 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 095d3ca commit 2cebf777e3827c4325f8e4d8e3f2d55f21b603a5 @malcolmt malcolmt committed May 16, 2007
Showing with 2 additions and 1 deletion.
  1. +2 −1 django/utils/dateformat.py
View
3 django/utils/dateformat.py
@@ -14,6 +14,7 @@
from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS
from django.utils.tzinfo import LocalTimezone
from django.utils.translation import ugettext as _
+from django.utils.encoding import smart_unicode
from calendar import isleap, monthrange
import re, time
@@ -25,7 +26,7 @@ def format(self, formatstr):
pieces = []
for i, piece in enumerate(re_formatchars.split(formatstr)):
if i % 2:
- pieces.append(str(getattr(self, piece)()))
+ pieces.append(smart_unicode(getattr(self, piece)()))
elif piece:
pieces.append(re_escaped.sub(r'\1', piece))
return u''.join(pieces)

0 comments on commit 2cebf77

Please sign in to comment.