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:
parent
fa14e3127d
commit
34ddcd9939
|
@ -128,7 +128,7 @@ class DateFormat(TimeFormat):
|
|||
ISO 8601 Format
|
||||
Example : '2008-01-02T10:30:00.000123'
|
||||
"""
|
||||
return self.data.isoformat(' ')
|
||||
return self.data.isoformat()
|
||||
|
||||
def d(self):
|
||||
"Day of the month, 2 digits with leading zeros; i.e. '01' to '31'"
|
||||
|
|
|
@ -657,7 +657,7 @@ Available format strings:
|
|||
A ``'AM'`` or ``'PM'``. ``'AM'``
|
||||
b Month, textual, 3 letters, lowercase. ``'jan'``
|
||||
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'``
|
||||
leading zeros.
|
||||
D Day of the week, textual, 3 letters. ``'Fri'``
|
||||
|
|
|
@ -42,7 +42,7 @@ class DateFormatTests(TestCase):
|
|||
timestamp = datetime.datetime(2008, 5, 19, 11, 45, 23, 123456)
|
||||
|
||||
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, 'j'), u'8')
|
||||
self.assertEquals(dateformat.format(my_birthday, 'l'), u'Sunday')
|
||||
|
|
Loading…
Reference in New Issue