diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php index 505b42b42e2d..51b68345f738 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php @@ -137,10 +137,18 @@ public function buildForm(FormBuilderInterface $builder, array $options) $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']; } @@ -235,6 +243,8 @@ public function configureOptions(OptionsResolver $resolver) // this option. 'data_class' => null, 'compound' => $compound, + 'date_label' => null, + 'time_label' => null, )); // Don't add some defaults in order to preserve the defaults