[Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323
This commit is contained in:
parent
aa04f35092
commit
f42c73f213
@ -163,6 +163,10 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer
|
||||
$dateFormat = $this->dateFormat;
|
||||
$timeFormat = $this->timeFormat;
|
||||
$timezone = $ignoreTimezone ? 'UTC' : $this->outputTimezone;
|
||||
if (class_exists('IntlTimeZone', false)) {
|
||||
// see https://bugs.php.net/bug.php?id=66323
|
||||
$timezone = \IntlTimeZone::createTimeZone($timezone);
|
||||
}
|
||||
$calendar = $this->calendar;
|
||||
$pattern = $this->pattern;
|
||||
|
||||
|
@ -77,7 +77,8 @@ class DateType extends AbstractType
|
||||
\Locale::getDefault(),
|
||||
$dateFormat,
|
||||
$timeFormat,
|
||||
null,
|
||||
// see https://bugs.php.net/bug.php?id=66323
|
||||
class_exists('IntlTimeZone', false) ? \IntlTimeZone::createDefault() : null,
|
||||
$calendar,
|
||||
$pattern
|
||||
);
|
||||
|
Reference in New Issue
Block a user