-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Documented the new date_label and time_label options #10389
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | |
+----------------------+-----------------------------------------------------------------------------+ | ||
| Options | - `choice_translation_domain`_ | | ||
| | - `date_format`_ | | ||
| | - `date_label`_ | | ||
| | - `date_widget`_ | | ||
| | - `days`_ | | ||
| | - `placeholder`_ | | ||
|
@@ -28,6 +29,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | |
| | - `model_timezone`_ | | ||
| | - `months`_ | | ||
| | - `seconds`_ | | ||
| | - `time_label`_ | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and we need to change the order below then too |
||
| | - `time_widget`_ | | ||
| | - `view_timezone`_ | | ||
| | - `widget`_ | | ||
|
@@ -72,6 +74,23 @@ date_widget | |
|
||
.. include:: /reference/forms/types/options/date_widget_description.rst.inc | ||
|
||
date_label | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like we need to move this up :) |
||
~~~~~~~~~~ | ||
|
||
**type**: ``string`` | ``null`` **default**: The label is "guessed" from the field name | ||
|
||
.. versionadded:: 4.2 | ||
The ``date_label`` option was introduced in Symfony 4.2. | ||
|
||
Sets the label that will be used when rendering the date widget. Setting it to | ||
``false`` will suppress the label:: | ||
|
||
use Symfony\Component\Form\Extension\Core\Type\DateTimeType; | ||
|
||
$builder->add('startDateTime', DateTimeType::class, array( | ||
'date_label' => 'Starts On', | ||
)); | ||
|
||
.. include:: /reference/forms/types/options/days.rst.inc | ||
|
||
placeholder | ||
|
@@ -151,6 +170,23 @@ time_widget | |
|
||
Defines the ``widget`` option for the :doc:`TimeType </reference/forms/types/time>`. | ||
|
||
time_label | ||
~~~~~~~~~~ | ||
|
||
**type**: ``string`` | ``null`` **default**: The label is "guessed" from the field name | ||
|
||
.. versionadded:: 4.2 | ||
The ``time_label`` option was introduced in Symfony 4.2. | ||
|
||
Sets the label that will be used when rendering the time widget. Setting it to | ||
``false`` will suppress the label:: | ||
|
||
use Symfony\Component\Form\Extension\Core\Type\DateTimeType; | ||
|
||
$builder->add('startDateTime', DateTimeType::class, array( | ||
'time_label' => 'Starts On', | ||
)); | ||
|
||
.. include:: /reference/forms/types/options/view_timezone.rst.inc | ||
|
||
widget | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should sort the options IMO