diff options
| author | Claude Paroz <claude@2xlibre.net> | 2020-01-04 10:25:23 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-06 11:39:47 +0100 |
| commit | 4853d0fdc4e5860086c5a7f876485a9661b7f71f (patch) | |
| tree | d071d6a69162be771de92c3c345b2917a9352ac5 | |
| parent | 4f81f6d2364f00262f4577fc1de4e0a6ff424e89 (diff) | |
[3.0.x] Corrected notes about default date/datetime/time input formats.
Backport of b23fb2c8198aee5c209bb24c0738d71970cffdc4 from master
| -rw-r--r-- | docs/ref/forms/fields.txt | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index d57722bae0..1d08e2d069 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -467,25 +467,11 @@ For each field, we describe the default widget used if you don't specify A list of formats used to attempt to convert a string to a valid ``datetime.date`` object. - If no ``input_formats`` argument is provided, the default input formats are:: - - ['%Y-%m-%d', # '2006-10-25' - '%m/%d/%Y', # '10/25/2006' - '%m/%d/%y'] # '10/25/06' - - Additionally, if you specify :setting:`USE_L10N=False<USE_L10N>` in your settings, the - following will also be included in the default input formats:: - - ['%b %d %Y', # 'Oct 25 2006' - '%b %d, %Y', # 'Oct 25, 2006' - '%d %b %Y', # '25 Oct 2006' - '%d %b, %Y', # '25 Oct, 2006' - '%B %d %Y', # 'October 25 2006' - '%B %d, %Y', # 'October 25, 2006' - '%d %B %Y', # '25 October 2006' - '%d %B, %Y'] # '25 October, 2006' - - See also :doc:`format localization </topics/i18n/formatting>`. + If no ``input_formats`` argument is provided, the default input formats are + taken from :setting:`DATE_INPUT_FORMATS` if :setting:`USE_L10N` is + ``False``, or from the active locale format ``DATE_INPUT_FORMATS`` key if + localization is enabled. See also :doc:`format localization + </topics/i18n/formatting>`. ``DateTimeField`` ----------------- @@ -506,19 +492,11 @@ For each field, we describe the default widget used if you don't specify A list of formats used to attempt to convert a string to a valid ``datetime.datetime`` object. - If no ``input_formats`` argument is provided, the default input formats are:: - - ['%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59' - '%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', # '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', # '10/25/06 14:30' - '%m/%d/%y'] # '10/25/06' - - See also :doc:`format localization </topics/i18n/formatting>`. + 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>`. ``DecimalField`` ---------------- @@ -928,10 +906,11 @@ For each field, we describe the default widget used if you don't specify A list of formats used to attempt to convert a string to a valid ``datetime.time`` object. - If no ``input_formats`` argument is provided, the default input formats are:: - - '%H:%M:%S', # '14:30:59' - '%H:%M', # '14:30' + If no ``input_formats`` argument is provided, the default input formats are + taken from :setting:`TIME_INPUT_FORMATS` if :setting:`USE_L10N` is + ``False``, or from the active locale format ``TIME_INPUT_FORMATS`` key if + localization is enabled. See also :doc:`format localization + </topics/i18n/formatting>`. ``URLField`` ------------ |
