Commit c75bcb23 by Peter Fogg

Merge pull request #12546 from edx/peter-fogg/date-summary-unicode-fixes

Fix date summaries with Unicode format issues.
parents 569ac193 c1a59cc0
......@@ -111,7 +111,7 @@ class DateSummary(object):
date_format = _(u"{relative} ago - {absolute}") if date_has_passed else _(u"in {relative} - {absolute}")
return date_format.format(
relative=relative_date,
absolute=self.date.strftime(self.date_format),
absolute=self.date.strftime(self.date_format.encode('utf-8')).decode('utf-8'),
)
@property
......@@ -157,7 +157,9 @@ class TodaysDate(DateSummary):
@property
def title(self):
return _(u'Today is {date}').format(date=datetime.now(pytz.UTC).strftime(self.date_format))
return _(u'Today is {date}').format(
date=datetime.now(pytz.UTC).strftime(self.date_format.encode('utf-8')).decode('utf-8')
)
class CourseStartDate(DateSummary):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment