Skip to content

Commit

Permalink
Change IntlTimeZone to DateTimeZone
Browse files Browse the repository at this point in the history
  • Loading branch information
aweelex committed Jun 6, 2019
1 parent cf12eff commit db372de
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,8 @@ protected function getIntlDateFormatter($ignoreTimezone = false)
{
$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);
$timezone = new \DateTimeZone($ignoreTimezone ? 'UTC' : $this->outputTimezone);

if ('Etc/Unknown' === $timezone->getID()) {
throw new \IntlException(sprintf('Timezone "%s" is not available. Check your ICU version or try to set a valid timezone.', $this->outputTimezone));
}
}
$calendar = $this->calendar;
$pattern = $this->pattern;

Expand Down

0 comments on commit db372de

Please sign in to comment.