@@ -17,6 +17,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
1717+----------------------+-----------------------------------------------------------------------------+
1818| Options | - `choice_translation_domain `_ |
1919| | - `date_format `_ |
20+ | | - `date_label `_ |
2021| | - `date_widget `_ |
2122| | - `days `_ |
2223| | - `placeholder `_ |
@@ -28,6 +29,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
2829| | - `model_timezone `_ |
2930| | - `months `_ |
3031| | - `seconds `_ |
32+ | | - `time_label `_ |
3133| | - `time_widget `_ |
3234| | - `view_timezone `_ |
3335| | - `widget `_ |
@@ -67,6 +69,23 @@ Defines the ``format`` option that will be passed down to the date field.
6769See the :ref: `DateType's format option <reference-forms-type-date-format >`
6870for more details.
6971
72+ date_label
73+ ~~~~~~~~~~
74+
75+ **type **: ``string `` | ``null `` **default **: The label is "guessed" from the field name
76+
77+ .. versionadded :: 4.2
78+ The ``date_label `` option was introduced in Symfony 4.2.
79+
80+ Sets the label that will be used when rendering the date widget. Setting it to
81+ ``false `` will suppress the label::
82+
83+ use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
84+
85+ $builder->add('startDateTime', DateTimeType::class, array(
86+ 'date_label' => 'Starts On',
87+ ));
88+
7089date_widget
7190~~~~~~~~~~~
7291
@@ -144,6 +163,23 @@ this format.
144163
145164.. include :: /reference/forms/types/options/seconds.rst.inc
146165
166+ time_label
167+ ~~~~~~~~~~
168+
169+ **type **: ``string `` | ``null `` **default **: The label is "guessed" from the field name
170+
171+ .. versionadded :: 4.2
172+ The ``time_label `` option was introduced in Symfony 4.2.
173+
174+ Sets the label that will be used when rendering the time widget. Setting it to
175+ ``false `` will suppress the label::
176+
177+ use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
178+
179+ $builder->add('startDateTime', DateTimeType::class, array(
180+ 'time_label' => 'Starts On',
181+ ));
182+
147183time_widget
148184~~~~~~~~~~~
149185
0 commit comments