diff --git a/reference/forms/types/birthday.rst b/reference/forms/types/birthday.rst index cb4281fb370..257e13dcc42 100644 --- a/reference/forms/types/birthday.rst +++ b/reference/forms/types/birthday.rst @@ -29,6 +29,7 @@ option defaults to 120 years ago to the current year. | | - `placeholder`_ | | | - `format`_ | | | - `input`_ | +| | - `input_format`_ | | | - `model_timezone`_ | | | - `months`_ | | | - `view_timezone`_ | @@ -96,6 +97,8 @@ values for the year, month and day fields:: .. include:: /reference/forms/types/options/date_input.rst.inc +.. include:: /reference/forms/types/options/date_input_format.rst.inc + .. include:: /reference/forms/types/options/model_timezone.rst.inc .. include:: /reference/forms/types/options/months.rst.inc diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 16dcae7c1fe..2ecbbc4961b 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -21,6 +21,7 @@ and can understand a number of different input formats via the `input`_ option. | | - `format`_ | | | - `html5`_ | | | - `input`_ | +| | - `input_format`_ | | | - `model_timezone`_ | | | - `months`_ | | | - `view_timezone`_ | @@ -168,6 +169,8 @@ values for the year, month and day fields:: .. include:: /reference/forms/types/options/date_input.rst.inc +.. include:: /reference/forms/types/options/date_input_format.rst.inc + .. include:: /reference/forms/types/options/model_timezone.rst.inc .. include:: /reference/forms/types/options/months.rst.inc diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index a50b2ce7061..efb5a80435b 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -25,6 +25,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | | - `hours`_ | | | - `html5`_ | | | - `input`_ | +| | - `input_format`_ | | | - `minutes`_ | | | - `model_timezone`_ | | | - `months`_ | @@ -153,6 +154,13 @@ this format. .. include:: /reference/forms/types/options/_date_limitation.rst.inc +input_format +~~~~~~~~~~~~ + +**type**: ``string`` **default**: ``Y-m-d H:i:s`` + +.. include:: /reference/forms/types/options/date_input_format_description.rst.inc + .. include:: /reference/forms/types/options/minutes.rst.inc .. include:: /reference/forms/types/options/model_timezone.rst.inc diff --git a/reference/forms/types/options/date_input_format.rst.inc b/reference/forms/types/options/date_input_format.rst.inc new file mode 100644 index 00000000000..ead92072642 --- /dev/null +++ b/reference/forms/types/options/date_input_format.rst.inc @@ -0,0 +1,6 @@ +input_format +~~~~~~~~~~~~ + +**type**: ``string`` **default**: ``Y-m-d`` + +.. include:: /reference/forms/types/options/date_input_format_description.rst.inc diff --git a/reference/forms/types/options/date_input_format_description.rst.inc b/reference/forms/types/options/date_input_format_description.rst.inc new file mode 100644 index 00000000000..4cd9b353e31 --- /dev/null +++ b/reference/forms/types/options/date_input_format_description.rst.inc @@ -0,0 +1,8 @@ +.. versionadded:: 4.3 + + The ``input_format`` option was introduced in Symfony 4.3. + +If the ``input`` option is set to ``string``, this option specifies the format +of the date. This must be a valid `PHP date format`_. + +.. _`PHP date format`: https://secure.php.net/manual/en/function.date.php diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index 9c39dabccff..9c9c09865d0 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -20,6 +20,7 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. | | - `hours`_ | | | - `html5`_ | | | - `input`_ | +| | - `input_format`_ | | | - `minutes`_ | | | - `model_timezone`_ | | | - `seconds`_ | @@ -129,6 +130,18 @@ on your underlying object. Valid values are: The value that comes back from the form will also be normalized back into this format. +input_format +~~~~~~~~~~~~ + +**type**: ``string`` **default**: ``H:i:s`` + +.. versionadded:: 4.3 + + The ``input_format`` option was introduced in Symfony 4.3. + +If the ``input`` option is set to ``string``, this option specifies the format +of the time. This must be a valid `PHP time format`_. + .. include:: /reference/forms/types/options/minutes.rst.inc .. include:: /reference/forms/types/options/model_timezone.rst.inc @@ -222,3 +235,5 @@ Form Variables | type | ``string`` | Only present when widget is ``single_text`` and HTML5 is activated, | | | | contains the input type to use (``datetime``, ``date`` or ``time``). | +--------------+-------------+----------------------------------------------------------------------+ + +.. _`PHP time format`: https://secure.php.net/manual/en/function.date.php pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy