summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2020-01-04 10:25:23 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-01-06 09:44:12 +0100
commitb23fb2c8198aee5c209bb24c0738d71970cffdc4 (patch)
tree7920d5da46105fe11acdebf029d7ca8da90fc8bc
parent0f843fdd5b9b2f2307148465cd60f4e1b2befbb4 (diff)
downloaddjango-b23fb2c8198aee5c209bb24c0738d71970cffdc4.tar.gz
Corrected notes about default date/datetime/time input formats.
-rw-r--r--docs/ref/forms/fields.txt51
1 files changed, 15 insertions, 36 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index a74980a845..b5854002c0 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``
------------