[Form] Added options for separate date/time labels in DateTimeType.

This commit is contained in:
Markus 2016-12-20 19:27:28 +01:00 committed by Fabien Potencier
parent d29fc2ca9e
commit df191552b4
1 changed files with 10 additions and 0 deletions

View File

@ -142,10 +142,18 @@ class DateTimeType extends AbstractType
$dateOptions['widget'] = $options['date_widget'];
}
if (null !== $options['date_label']) {
$dateOptions['label'] = $options['date_label'];
}
if (null !== $options['time_widget']) {
$timeOptions['widget'] = $options['time_widget'];
}
if (null !== $options['time_label']) {
$timeOptions['label'] = $options['time_label'];
}
if (null !== $options['date_format']) {
$dateOptions['format'] = $options['date_format'];
}
@ -238,6 +246,8 @@ class DateTimeType extends AbstractType
// this option.
'data_class' => null,
'compound' => $compound,
'date_label' => null,
'time_label' => null,
));
// Don't add some defaults in order to preserve the defaults