Procházet zdrojové kódy

Changed instances of \DateTimeZone::UTC to 'UTC' as the constant is not valid a produces this error when DateTimeZone is instantiated: DateTimeZone::__construct() [<a href='datetimezone.--construct'>datetimezone.--construct</a>]: Unknown or bad timezone (1024)

Drew Butler před 13 roky
rodič
revize
8642473185

+ 1 - 1
src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php

@@ -39,7 +39,7 @@ class MonthChoiceList extends PaddedChoiceList
         $pattern = $this->formatter->getPattern();
         $timezone = $this->formatter->getTimezoneId();
 
-        $this->formatter->setTimezoneId(\DateTimeZone::UTC);
+        $this->formatter->setTimezoneId('UTC');
 
         if (preg_match('/M+/', $pattern, $matches)) {
             $this->formatter->setPattern($matches[0]);

+ 1 - 1
src/Symfony/Component/Form/Extension/Core/Type/DateType.php

@@ -57,7 +57,7 @@ class DateType extends AbstractType
             \Locale::getDefault(),
             $format,
             \IntlDateFormatter::NONE,
-            \DateTimeZone::UTC,
+            'UTC',
             \IntlDateFormatter::GREGORIAN,
             $pattern
         );

+ 1 - 1
tests/Symfony/Tests/Component/Form/Extension/Core/ChoiceList/MonthChoiceListTest.php

@@ -31,7 +31,7 @@ class MonthChoiceListTest extends \PHPUnit_Framework_TestCase
             \Locale::getDefault(),
             \IntlDateFormatter::SHORT,
             \IntlDateFormatter::NONE,
-            \DateTimeZone::UTC
+            'UTC'
         );
     }