Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
Show file tree
Hide file tree
Changes fromall commits
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 deletionsreference/forms/types/birthday.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionsreference/forms/types/date.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionsreference/forms/types/datetime.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionsreference/forms/types/options/date_input_format.rst.inc
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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
of the date. This must be a valid `PHP date format`_.

.. _`PHP date format`: https://secure.php.net/manual/en/function.date.php
15 changes: 15 additions & 0 deletionsreference/forms/types/time.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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`_ |
Expand DownExpand Up@@ -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
Expand DownExpand Up@@ -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

[8]ページ先頭

©2009-2025 Movatter.jp