Skip to content

Commit

Permalink
Update ImageSliderType.php
Browse files Browse the repository at this point in the history
Add param 'with_seconds' as stated in DateTimeType.

We need to force the browser to display the seconds by adding the HTML attribute step if not already defined.
Otherwise the browser will not display and so not send the seconds therefore the value will always be considered as invalid.
  • Loading branch information
Aerue authored Sep 30, 2023
1 parent 95dfa11 commit 7e497ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Form/ImageSliderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'widget' => 'single_text',
'html5' => true,
'input' => 'datetime',
'with_seconds' => true
])
->add('display_to', DateTimeType::class, [
'label' => $this->trans('Display to', TranslationDomains::TRANSLATION_DOMAIN_ADMIN),
'required' => true,
'widget' => 'single_text',
'html5' => true,
'input' => 'datetime',
'with_seconds' => true
]);

if ($this->isMultistoreUsed) {
Expand Down

0 comments on commit 7e497ca

Please sign in to comment.