From 34ddcd9939568e7d19a0059647a9faaf36972083 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sun, 16 May 2010 15:54:10 +0000 Subject: [PATCH] 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 --- django/utils/dateformat.py | 2 +- docs/ref/templates/builtins.txt | 2 +- tests/regressiontests/dateformat/tests.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py index 13cc2c7a81..efec5c35fe 100644 --- a/django/utils/dateformat.py +++ b/django/utils/dateformat.py @@ -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'" diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 24c0af5699..393aab99e5 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -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'`` diff --git a/tests/regressiontests/dateformat/tests.py b/tests/regressiontests/dateformat/tests.py index 42c582cd0f..545b17d377 100644 --- a/tests/regressiontests/dateformat/tests.py +++ b/tests/regressiontests/dateformat/tests.py @@ -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')