Change IntlTimeZone to DateTimeZone

This commit is contained in:
Александр Ли 2019-06-06 15:54:42 +05:00
parent 2ae0580eea
commit a6025ab5ee

View File

@ -162,11 +162,8 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer
{ {
$dateFormat = $this->dateFormat; $dateFormat = $this->dateFormat;
$timeFormat = $this->timeFormat; $timeFormat = $this->timeFormat;
$timezone = $ignoreTimezone ? 'UTC' : $this->outputTimezone; $timezone = new \DateTimeZone($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;