From 128f8b885254389fb165c58f35cfc3346a65c7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 19 Nov 2024 15:40:53 +0100 Subject: [PATCH] Fix normalization of Date: use the same timezone as the original date --- .../Serializer/Normalizer/DateNormalizer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php index 9ee8bf158..e17c0120c 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php @@ -74,12 +74,14 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt $formatterLong = \IntlDateFormatter::create( $locale, \IntlDateFormatter::LONG, - $hasTime ? \IntlDateFormatter::SHORT : \IntlDateFormatter::NONE + $hasTime ? \IntlDateFormatter::SHORT : \IntlDateFormatter::NONE, + $date->getTimezone(), ); $formatterShort = \IntlDateFormatter::create( $locale, \IntlDateFormatter::SHORT, - $hasTime ? \IntlDateFormatter::SHORT : \IntlDateFormatter::NONE + $hasTime ? \IntlDateFormatter::SHORT : \IntlDateFormatter::NONE, + $date->getTimezone(), ); return [