[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;
|
$dateFormat = $this->dateFormat;
|
||||||
$timeFormat = $this->timeFormat;
|
$timeFormat = $this->timeFormat;
|
||||||
$timezone = $ignoreTimezone ? 'UTC' : $this->outputTimezone;
|
$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;
|
$calendar = $this->calendar;
|
||||||
$pattern = $this->pattern;
|
$pattern = $this->pattern;
|
||||||
|
|
||||||
|
@ -77,7 +77,8 @@ class DateType extends AbstractType
|
|||||||
\Locale::getDefault(),
|
\Locale::getDefault(),
|
||||||
$dateFormat,
|
$dateFormat,
|
||||||
$timeFormat,
|
$timeFormat,
|
||||||
null,
|
// see https://bugs.php.net/bug.php?id=66323
|
||||||
|
class_exists('IntlTimeZone', false) ? \IntlTimeZone::createDefault() : null,
|
||||||
$calendar,
|
$calendar,
|
||||||
$pattern
|
$pattern
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user