Skip to content

[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions reference/forms/types/birthday.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option defaults to 120 years ago to the current year.
| | - `placeholder`_ |
| | - `format`_ |
| | - `input`_ |
| | - `input_format`_ |
| | - `model_timezone`_ |
| | - `months`_ |
| | - `view_timezone`_ |
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`_ |
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`_ |
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions reference/forms/types/options/date_input_format.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
input_format
~~~~~~~~~~~~

**type**: ``string`` **default**: ``Y-m-d``

.. include:: /reference/forms/types/options/date_input_format_description.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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