Fixed #13547 -- Made sure the ISO 8601 date formatting introduced in r12058 uses "T" as the separator between the date and the time value to increase real world usefulness.

While the ISO standard permits the use of a space instead of "T" for readability, it does have an impact on standards like HTML5 which rely on specific rules made in RFC 3339.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13266 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2010-05-16 15:54:10 +00:00
parent fa14e3127d
commit 34ddcd9939
3 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ class DateFormat(TimeFormat):
ISO 8601 Format ISO 8601 Format
Example : '2008-01-02T10:30:00.000123' Example : '2008-01-02T10:30:00.000123'
""" """
return self.data.isoformat(' ') return self.data.isoformat()
def d(self): def d(self):
"Day of the month, 2 digits with leading zeros; i.e. '01' to '31'" "Day of the month, 2 digits with leading zeros; i.e. '01' to '31'"

View File

@ -657,7 +657,7 @@ Available format strings:
A ``'AM'`` or ``'PM'``. ``'AM'`` A ``'AM'`` or ``'PM'``. ``'AM'``
b Month, textual, 3 letters, lowercase. ``'jan'`` b Month, textual, 3 letters, lowercase. ``'jan'``
B Not implemented. B Not implemented.
c ISO 8601 Format. ``2008-01-02 10:30:00.000123`` c ISO 8601 Format. ``2008-01-02T10:30:00.000123``
d Day of the month, 2 digits with ``'01'`` to ``'31'`` d Day of the month, 2 digits with ``'01'`` to ``'31'``
leading zeros. leading zeros.
D Day of the week, textual, 3 letters. ``'Fri'`` D Day of the week, textual, 3 letters. ``'Fri'``

View File

@ -42,7 +42,7 @@ class DateFormatTests(TestCase):
timestamp = datetime.datetime(2008, 5, 19, 11, 45, 23, 123456) timestamp = datetime.datetime(2008, 5, 19, 11, 45, 23, 123456)
self.assertEquals(dateformat.format(my_birthday, 'A'), u'PM') self.assertEquals(dateformat.format(my_birthday, 'A'), u'PM')
self.assertEquals(dateformat.format(timestamp, 'c'), u'2008-05-19 11:45:23.123456') self.assertEquals(dateformat.format(timestamp, 'c'), u'2008-05-19T11:45:23.123456')
self.assertEquals(dateformat.format(my_birthday, 'd'), u'08') self.assertEquals(dateformat.format(my_birthday, 'd'), u'08')
self.assertEquals(dateformat.format(my_birthday, 'j'), u'8') self.assertEquals(dateformat.format(my_birthday, 'j'), u'8')
self.assertEquals(dateformat.format(my_birthday, 'l'), u'Sunday') self.assertEquals(dateformat.format(my_birthday, 'l'), u'Sunday')