@@ -17,6 +17,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
17
17
+----------------------+-----------------------------------------------------------------------------+
18
18
| Options | - `choice_translation_domain `_ |
19
19
| | - `date_format `_ |
20
+ | | - `date_label `_ |
20
21
| | - `date_widget `_ |
21
22
| | - `days `_ |
22
23
| | - `placeholder `_ |
@@ -28,6 +29,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
28
29
| | - `model_timezone `_ |
29
30
| | - `months `_ |
30
31
| | - `seconds `_ |
32
+ | | - `time_label `_ |
31
33
| | - `time_widget `_ |
32
34
| | - `view_timezone `_ |
33
35
| | - `widget `_ |
@@ -67,6 +69,23 @@ Defines the ``format`` option that will be passed down to the date field.
67
69
See the :ref: `DateType's format option <reference-forms-type-date-format >`
68
70
for more details.
69
71
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
+
70
89
date_widget
71
90
~~~~~~~~~~~
72
91
@@ -144,6 +163,23 @@ this format.
144
163
145
164
.. include :: /reference/forms/types/options/seconds.rst.inc
146
165
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
+
147
183
time_widget
148
184
~~~~~~~~~~~
149
185
0 commit comments