Opened 6 years ago

Closed 5 years ago

#14294 closed Bug (fixed)

default input_format not honoroed

Reported by: danols@… Owned by: nobody
Component: Documentation Version: 1.2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


form.DateField() only accepts following formats:

'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'

But fails to accept:

'%b %d %Y', '%b %d, %Y',            # 'Oct 25 2006', 'Oct 25, 2006'
'%d %b %Y', '%d %b, %Y',            # '25 Oct 2006', '25 Oct, 2006'
'%B %d %Y', '%B %d, %Y',            # 'October 25 2006', 'October 25, 2006'
'%d %B %Y', '%d %B, %Y',            # '25 October 2006', '25 October, 2006'

Documentations states all above should be accepted:


Change History (6)

comment:1 Changed 6 years ago by Karen Tracey

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Hmm, indeed. Those other formats were specifically disabled in r13039, which added some doc about how those formats can't be used for localized dates, but we seem to have overlooked the fact they they were included in the defaults pre-localization-support. The settings doc also has it wrong right now.

comment:2 Changed 6 years ago by Ramiro Morales

Component: UncategorizedDocumentation

comment:3 Changed 6 years ago by Ramiro Morales

#15135 was a duplicate.

comment:4 Changed 5 years ago by Julien Phalip

Severity: Normal
Type: Bug

comment:5 Changed 5 years ago by Karen Tracey

Easy pickings: unset
UI/UX: unset, I believe, is a more accurate description than what I said above of the current situation. What both the datefield doc and the settings doc fail to mention is that what they are showing is the default for the USE_L10N=False case. Datefield doc perhaps should be nothing that the defaults (for the USE_L10N=False case) are the DATE_INPUT_FORMATS setting. In the USE_L10N=True case it's not feasible to try to state the defaults, because it varies by locale.

Also, #17532 reported this again.

comment:6 Changed 5 years ago by Karen Tracey

Resolution: fixed
Status: newclosed

[17554] clarified the documentation, which is the fix for this.

Note: See TracTickets for help on using tickets.
Back to Top