diff --git a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php index 31eedfc3d31b3..9e7225a05e8fd 100644 --- a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php +++ b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php @@ -604,7 +604,7 @@ protected function getDefaultPattern() if (self::NONE !== $this->timetype) { $patternParts[] = $this->defaultTimeFormats[$this->timetype]; } - $pattern = implode(' ', $patternParts); + $pattern = implode(', ', $patternParts); return $pattern; } diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php index 4e7b0160fb3ad..b499eae850858 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php @@ -30,6 +30,21 @@ public function testConstructorWithUnsupportedLocale() new IntlDateFormatter('pt_BR', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT); } + public function testEqualWithNative() + { + $native = \IntlDateFormatter::create('en', \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT); + + if ($native instanceof IntlDateFormatter) { + $this->markTestSkipped('No intl extension installed'); + } + + $replacement = IntlDateFormatter::create('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT); + + $time = time(); + + $this->assertSame($native->format($time), $replacement->format($time)); + } + public function testStaticCreate() { $formatter = IntlDateFormatter::create('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);