Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Form] Add input_format option to DateType, DateTimeType and TimeType#10882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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`` | ||
fancyweb marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| .. 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| input_format | ||
| ~~~~~~~~~~~~ | ||
| **type**: ``string`` **default**: ``Y-m-d`` | ||
fancyweb marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| ..include:: /reference/forms/types/options/date_input_format_description.rst.inc | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
xabbuh marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| of the date. This must be a valid `PHP date format`_. | ||
| .. _`PHP date format`: https://secure.php.net/manual/en/function.date.php | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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`` | ||
fancyweb marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| .. 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 | ||
xabbuh marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| 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 | ||