From 6ab93bd4ef45430f5723f4acc2cdec1f806054c6 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Mon, 18 Dec 2017 05:45:05 -0800 Subject: [PATCH] a => A (fixes #15380) --- framework/CHANGELOG.md | 1 + framework/helpers/BaseFormatConverter.php | 2 +- tests/framework/helpers/FormatConverterTest.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index f6053cb93f3..eeaaffad4d0 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -37,6 +37,7 @@ Yii Framework 2 Change Log - Enh #15340: Test CHANGELOG.md for valid format (sammousa) - Enh #15360: Refactored `BaseConsole::updateProgress()` (developeruz) - Bug #15317: Regenerate CSRF token if an empty value is given (sammousa) +- Bug #15380: `FormatConverter::convertDateIcuToPhp()` now converts `a` ICU symbols to `A` (brandonkelly) diff --git a/framework/helpers/BaseFormatConverter.php b/framework/helpers/BaseFormatConverter.php index c54a8e8587c..9fc5785c92e 100644 --- a/framework/helpers/BaseFormatConverter.php +++ b/framework/helpers/BaseFormatConverter.php @@ -185,7 +185,7 @@ public static function convertDateIcuToPhp($pattern, $type = 'date', $locale = n 'cccc' => 'l', 'ccccc' => '', 'cccccc' => '', - 'a' => 'a', // am/pm marker + 'a' => 'A', // AM/PM marker 'h' => 'g', // 12-hour format of an hour without leading zeros 1 to 12h 'hh' => 'h', // 12-hour format of an hour with leading zeros, 01 to 12 h 'H' => 'G', // 24-hour format of an hour without leading zeros 0 to 23h diff --git a/tests/framework/helpers/FormatConverterTest.php b/tests/framework/helpers/FormatConverterTest.php index e928b372869..e7f273527b8 100644 --- a/tests/framework/helpers/FormatConverterTest.php +++ b/tests/framework/helpers/FormatConverterTest.php @@ -45,13 +45,13 @@ public function testIntlIcuToPhpShortForm() public function testEscapedIcuToPhp() { - $this->assertEquals('l, F j, Y \\a\\t g:i:s a T', FormatConverter::convertDateIcuToPhp('EEEE, MMMM d, y \'at\' h:mm:ss a zzzz')); + $this->assertEquals('l, F j, Y \\a\\t g:i:s A T', FormatConverter::convertDateIcuToPhp('EEEE, MMMM d, y \'at\' h:mm:ss a zzzz')); $this->assertEquals('\\o\\\'\\c\\l\\o\\c\\k', FormatConverter::convertDateIcuToPhp('\'o\'\'clock\'')); } public function testEscapedIcuToJui() { - $this->assertEquals('l, F j, Y \\a\\t g:i:s a T', FormatConverter::convertDateIcuToPhp('EEEE, MMMM d, y \'at\' h:mm:ss a zzzz')); + $this->assertEquals('l, F j, Y \\a\\t g:i:s A T', FormatConverter::convertDateIcuToPhp('EEEE, MMMM d, y \'at\' h:mm:ss a zzzz')); $this->assertEquals('\'o\'\'clock\'', FormatConverter::convertDateIcuToJui('\'o\'\'clock\'')); }