diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php index c538c09a00..5bb70a39ec 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php @@ -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