Opened 14 years ago
Closed 14 years ago
#15135 closed (duplicate)
Default input_formats for forms.DateField not as documented
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | vim@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There seem to be significantly fewer default date input formats than are listed in the forms.DateField documentation.
In [5]: from django.utils import formats In [6]: formats.get_format('DATE_INPUT_FORMATS') Out[6]: ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y')
I don't know if this is a bug in the documentation or the l10n (I hope it's the latter).
Note:
See TracTickets
for help on using tickets.
That doc is a bit out-of-date in that it does not take into account localization. If USE_L10N is True, then your default date input formats are determined by the locale, and yes, the default input formats when using localization support are not as many as shown in that doc. (As for why see #13339.)
If USE_L10N is False, you get the defaults listed in the doc:
I think the referenced documentation needs to be updated to mention that that "default" is only the default in cases where USE_L10N is False, and probably point to the L10N docs for more info on what the default is when localization support is being used.