[Form] Fix failing MonthChoiceList
in PHP 5.5
This commit is contained in:
parent
f4ce2f1a40
commit
8ae773b486
@ -39,7 +39,11 @@ class MonthChoiceList extends PaddedChoiceList
|
||||
$pattern = $this->formatter->getPattern();
|
||||
$timezone = $this->formatter->getTimezoneId();
|
||||
|
||||
if (version_compare(phpversion(), '5.5.0alpha1', '<')) {
|
||||
$this->formatter->setTimezoneId('UTC');
|
||||
} else {
|
||||
$this->formatter->setTimezone('UTC');
|
||||
}
|
||||
|
||||
if (preg_match('/M+/', $pattern, $matches)) {
|
||||
$this->formatter->setPattern($matches[0]);
|
||||
@ -53,6 +57,10 @@ class MonthChoiceList extends PaddedChoiceList
|
||||
$this->formatter->setPattern($pattern);
|
||||
}
|
||||
|
||||
if (version_compare(phpversion(), '5.5.0alpha1', '<')) {
|
||||
$this->formatter->setTimezoneId($timezone);
|
||||
} else {
|
||||
$this->formatter->setTimezone($timezone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user