Skip to content

Commit 4e0aa65

Browse files
committed
Refs #13339 -- Disable %b/%B-based locale datetime input formats, and document that they are problematic.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent cae4401 commit 4e0aa65

File tree

12 files changed

+47
-41
lines changed

12 files changed

+47
-41
lines changed

django/conf/locale/cs/formats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DATE_INPUT_FORMATS = (
1414
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
1515
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
16-
'%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
16+
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
1717
)
1818
TIME_INPUT_FORMATS = (
1919
'%H:%M:%S', # '14:30:59'

django/conf/locale/de/formats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DATE_INPUT_FORMATS = (
1414
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
1515
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
16-
'%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
16+
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
1717
)
1818
TIME_INPUT_FORMATS = (
1919
'%H:%M:%S', # '14:30:59'

django/conf/locale/en/formats.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
FIRST_DAY_OF_WEEK = 0 # Sunday
1313
DATE_INPUT_FORMATS = (
1414
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
15-
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
16-
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
17-
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
18-
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
15+
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
16+
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
17+
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
18+
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
1919
)
2020
TIME_INPUT_FORMATS = (
2121
'%H:%M:%S', # '14:30:59'

django/conf/locale/fr/formats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
1515
'%d.%m.%Y', '%d.%m.%y', # Swiss (fr_CH), '25.10.2006', '25.10.06'
1616
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
17-
'%d %B %Y', '%d %b %Y', # '25 octobre 2006', '25 oct. 2006'
17+
# '%d %B %Y', '%d %b %Y', # '25 octobre 2006', '25 oct. 2006'
1818
)
1919
TIME_INPUT_FORMATS = (
2020
'%H:%M:%S', # '14:30:59'

django/conf/locale/ka/formats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
FIRST_DAY_OF_WEEK = 1 # (Monday)
1313
DATE_INPUT_FORMATS = (
1414
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
15-
'%d %b %Y', '%d %b, %Y', '%d %b. %Y', # '25 Oct 2006', '25 Oct, 2006', '25 Oct. 2006'
16-
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
17-
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
15+
# '%d %b %Y', '%d %b, %Y', '%d %b. %Y', # '25 Oct 2006', '25 Oct, 2006', '25 Oct. 2006'
16+
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
17+
# '%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
1818
)
1919
TIME_INPUT_FORMATS = (
2020
'%H:%M:%S', # '14:30:59'

django/conf/locale/ko/formats.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
MONTH_DAY_FORMAT = 'F월 j일'
1010
SHORT_DATE_FORMAT = 'Y-n-j.'
1111
SHORT_DATETIME_FORMAT = 'Y-n-j H:i'
12-
# FIRST_DAY_OF_WEEK =
12+
# FIRST_DAY_OF_WEEK =
1313
DATE_INPUT_FORMATS = (
1414
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
15-
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
16-
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
17-
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
18-
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
15+
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
16+
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
17+
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
18+
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
1919
'%Y년 %m월 %d일', # '2006년 10월 25일', with localized suffix.
2020
)
2121
TIME_INPUT_FORMATS = (

django/conf/locale/nl/formats.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
FIRST_DAY_OF_WEEK = 1 # Monday (in Dutch 'maandag')
1313
DATE_INPUT_FORMATS = (
1414
'%d-%m-%Y', '%d-%m-%y', '%Y-%m-%d', # '20-01-2009', '20-01-09', '2009-01-20'
15-
'%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
16-
'%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 09'
15+
# '%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
16+
# '%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 09'
1717
)
1818
TIME_INPUT_FORMATS = (
1919
'%H:%M:%S', # '15:23:35'
@@ -24,24 +24,24 @@
2424
DATETIME_INPUT_FORMATS = (
2525
# With time in %H:%M:%S :
2626
'%d-%m-%Y %H:%M:%S', '%d-%m-%y %H:%M:%S', '%Y-%m-%d %H:%M:%S', # '20-01-2009 15:23:35', '20-01-09 15:23:35', '2009-01-20 15:23:35'
27-
'%d %b %Y %H:%M:%S', '%d %b %y %H:%M:%S', # '20 jan 2009 15:23:35', '20 jan 09 15:23:35'
28-
'%d %B %Y %H:%M:%S', '%d %B %y %H:%M:%S', # '20 januari 2009 15:23:35', '20 januari 2009 15:23:35'
27+
# '%d %b %Y %H:%M:%S', '%d %b %y %H:%M:%S', # '20 jan 2009 15:23:35', '20 jan 09 15:23:35'
28+
# '%d %B %Y %H:%M:%S', '%d %B %y %H:%M:%S', # '20 januari 2009 15:23:35', '20 januari 2009 15:23:35'
2929
# With time in %H.%M:%S :
3030
'%d-%m-%Y %H.%M:%S', '%d-%m-%y %H.%M:%S', # '20-01-2009 15.23:35', '20-01-09 15.23:35'
31-
'%d %b %Y %H.%M:%S', '%d %b %y %H.%M:%S', # '20 jan 2009 15.23:35', '20 jan 09 15.23:35'
32-
'%d %B %Y %H.%M:%S', '%d %B %y %H.%M:%S', # '20 januari 2009 15.23:35', '20 januari 2009 15.23:35'
31+
# '%d %b %Y %H.%M:%S', '%d %b %y %H.%M:%S', # '20 jan 2009 15.23:35', '20 jan 09 15.23:35'
32+
# '%d %B %Y %H.%M:%S', '%d %B %y %H.%M:%S', # '20 januari 2009 15.23:35', '20 januari 2009 15.23:35'
3333
# With time in %H:%M :
3434
'%d-%m-%Y %H:%M', '%d-%m-%y %H:%M', '%Y-%m-%d %H:%M', # '20-01-2009 15:23', '20-01-09 15:23', '2009-01-20 15:23'
35-
'%d %b %Y %H:%M', '%d %b %y %H:%M', # '20 jan 2009 15:23', '20 jan 09 15:23'
36-
'%d %B %Y %H:%M', '%d %B %y %H:%M', # '20 januari 2009 15:23', '20 januari 2009 15:23'
35+
# '%d %b %Y %H:%M', '%d %b %y %H:%M', # '20 jan 2009 15:23', '20 jan 09 15:23'
36+
# '%d %B %Y %H:%M', '%d %B %y %H:%M', # '20 januari 2009 15:23', '20 januari 2009 15:23'
3737
# With time in %H.%M :
3838
'%d-%m-%Y %H.%M', '%d-%m-%y %H.%M', # '20-01-2009 15.23', '20-01-09 15.23'
39-
'%d %b %Y %H.%M', '%d %b %y %H.%M', # '20 jan 2009 15.23', '20 jan 09 15.23'
40-
'%d %B %Y %H.%M', '%d %B %y %H.%M', # '20 januari 2009 15.23', '20 januari 2009 15.23'
39+
# '%d %b %Y %H.%M', '%d %b %y %H.%M', # '20 jan 2009 15.23', '20 jan 09 15.23'
40+
# '%d %B %Y %H.%M', '%d %B %y %H.%M', # '20 januari 2009 15.23', '20 januari 2009 15.23'
4141
# Without time :
4242
'%d-%m-%Y', '%d-%m-%y', '%Y-%m-%d', # '20-01-2009', '20-01-09', '2009-01-20'
43-
'%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
44-
'%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 2009'
43+
# '%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
44+
# '%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 2009'
4545
)
4646
DECIMAL_SEPARATOR = ','
4747
THOUSAND_SEPARATOR = '.'

django/conf/locale/no/formats.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
FIRST_DAY_OF_WEEK = 1 # Monday
99
DATE_INPUT_FORMATS = (
1010
'%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
11-
'%Y-%m-%j', # '2006-10-25',
12-
'%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'
13-
'%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'
14-
'%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'
11+
'%Y-%m-%j', # '2006-10-25',
12+
# '%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'
13+
# '%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'
14+
# '%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'
1515
)
1616
TIME_INPUT_FORMATS = (
1717
'%H:%M:%S', # '14:30:59'

django/conf/locale/pt_BR/formats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
FIRST_DAY_OF_WEEK = 0 # Sunday
1313
DATE_INPUT_FORMATS = (
1414
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
15-
'%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'
16-
'%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'
15+
# '%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'
16+
# '%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'
1717
)
1818
TIME_INPUT_FORMATS = (
1919
'%H:%M:%S', # '14:30:59'

django/conf/locale/sr/formats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
'%Y-%m-%d', # '2006-10-25'
1515
'%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'
1616
'%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'
17-
'%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'
18-
'%d. %b \'%y.', '%d. %B \'%y.', # '25. Oct '06.', '25. October '06.'
19-
'%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'
17+
# '%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'
18+
# '%d. %b \'%y.', '%d. %B \'%y.', # '25. Oct '06.', '25. October '06.'
19+
# '%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'
2020
)
2121
TIME_INPUT_FORMATS = (
2222
'%H:%M:%S', # '14:30:59'

0 commit comments

Comments
 (0)