diff options
| author | Claude Paroz <claude@2xlibre.net> | 2020-01-04 11:44:11 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-07 11:08:40 +0100 |
| commit | 188b003014dc727ca22f7fafb21cf2fa0b3472d2 (patch) | |
| tree | 84b73ec73001ae076eab138f52ab93e8df47a72d /docs/ref | |
| parent | 0f0abc20be55d796ecfc3e7698e7ecfd9e9cdf88 (diff) | |
Fixed #15982 -- Added DATE_INPUT_FORMATS to forms.DateTimeField default input formats.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/forms/fields.txt | 12 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 10 |
2 files changed, 14 insertions, 8 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 7b26b29aee..d2a0550a47 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -505,16 +505,20 @@ For each field, we describe the default widget used if you don't specify * '2006-10-25' If no ``input_formats`` argument is provided, the default input formats are - taken from :setting:`DATETIME_INPUT_FORMATS` if :setting:`USE_L10N` is - ``False``, or from the active locale format ``DATETIME_INPUT_FORMATS`` key - if localization is enabled. See also :doc:`format localization - </topics/i18n/formatting>`. + taken from :setting:`DATETIME_INPUT_FORMATS` and + :setting:`DATE_INPUT_FORMATS` if :setting:`USE_L10N` is ``False``, or from + the active locale format ``DATETIME_INPUT_FORMATS`` and + ``DATE_INPUT_FORMATS`` keys if localization is enabled. See also + :doc:`format localization </topics/i18n/formatting>`. .. versionchanged:: 3.1 Support for ISO 8601 date string parsing (including optional timezone) was added. + The fallback on ``DATE_INPUT_FORMATS`` in the default ``input_formats`` + was added. + ``DecimalField`` ---------------- diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 1d92c50026..51bbba35f0 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1135,28 +1135,30 @@ Default:: '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59' '%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200' '%Y-%m-%d %H:%M', # '2006-10-25 14:30' - '%Y-%m-%d', # '2006-10-25' '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59' '%m/%d/%Y %H:%M:%S.%f', # '10/25/2006 14:30:59.000200' '%m/%d/%Y %H:%M', # '10/25/2006 14:30' - '%m/%d/%Y', # '10/25/2006' '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59' '%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200' '%m/%d/%y %H:%M', # '10/25/06 14:30' - '%m/%d/%y', # '10/25/06' ] A list of formats that will be accepted when inputting data on a datetime field. Formats will be tried in order, using the first valid one. Note that these format strings use Python's :ref:`datetime module syntax <strftime-strptime-behavior>`, not the format strings from the :tfilter:`date` -template filter. +template filter. Date-only formats are not included as datetime fields will +automatically try :setting:`DATE_INPUT_FORMATS` in last resort. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher precedence and will be applied instead. See also :setting:`DATE_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`. +.. versionchanged:: 3.1 + + In older versions, the default is a list containing also date-only formats. + .. setting:: DEBUG ``DEBUG`` |
