Fix normalization of Date: use the same timezone as the original date

This commit is contained in:
Julien Fastré 2024-11-19 15:40:53 +01:00
parent 6ca4b91e1e
commit 128f8b8852
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -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 [