From 7e497cae68655586f52cd76fdbf5a9f3d3953e54 Mon Sep 17 00:00:00 2001 From: PERRIGAULT Alexandre Date: Sun, 1 Oct 2023 00:53:14 +0200 Subject: [PATCH 1/2] Update ImageSliderType.php 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. --- src/Form/ImageSliderType.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Form/ImageSliderType.php b/src/Form/ImageSliderType.php index dfdbd16..2b3c8ce 100644 --- a/src/Form/ImageSliderType.php +++ b/src/Form/ImageSliderType.php @@ -134,6 +134,7 @@ 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), @@ -141,6 +142,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'widget' => 'single_text', 'html5' => true, 'input' => 'datetime', + 'with_seconds' => true ]); if ($this->isMultistoreUsed) { From d815faeb4036606ff6867137a48625899ab49312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Ste=CC=A8pien=CC=81?= Date: Mon, 23 Oct 2023 23:04:24 +0200 Subject: [PATCH 2/2] cs-fixer fix --- src/Form/ImageSliderType.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/ImageSliderType.php b/src/Form/ImageSliderType.php index 2b3c8ce..7621f53 100644 --- a/src/Form/ImageSliderType.php +++ b/src/Form/ImageSliderType.php @@ -134,7 +134,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'widget' => 'single_text', 'html5' => true, 'input' => 'datetime', - 'with_seconds' => true + 'with_seconds' => true, ]) ->add('display_to', DateTimeType::class, [ 'label' => $this->trans('Display to', TranslationDomains::TRANSLATION_DOMAIN_ADMIN), @@ -142,7 +142,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'widget' => 'single_text', 'html5' => true, 'input' => 'datetime', - 'with_seconds' => true + 'with_seconds' => true, ]); if ($this->isMultistoreUsed) {