Opened 14 years ago

Closed 13 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

Description

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: http://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield

Thanks

Change History (6)

comment:1 by Karen Tracey, 14 years ago

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 by Ramiro Morales, 14 years ago

Component: UncategorizedDocumentation

comment:3 by Ramiro Morales, 14 years ago

#15135 was a duplicate.

comment:4 by Julien Phalip, 13 years ago

Severity: Normal
Type: Bug

comment:5 by Karen Tracey, 13 years ago

Easy pickings: unset
UI/UX: unset

https://code.djangoproject.com/ticket/15135#comment:1, 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 by Karen Tracey, 13 years ago

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