a => A (fixes #15380)

This commit is contained in:
brandonkelly
2017-12-18 05:45:05 -08:00
parent 339f12969b
commit 6ab93bd4ef
3 changed files with 4 additions and 3 deletions

View File

@ -37,6 +37,7 @@ Yii Framework 2 Change Log
- Enh #15340: Test CHANGELOG.md for valid format (sammousa) - Enh #15340: Test CHANGELOG.md for valid format (sammousa)
- Enh #15360: Refactored `BaseConsole::updateProgress()` (developeruz) - Enh #15360: Refactored `BaseConsole::updateProgress()` (developeruz)
- Bug #15317: Regenerate CSRF token if an empty value is given (sammousa) - Bug #15317: Regenerate CSRF token if an empty value is given (sammousa)
- Bug #15380: `FormatConverter::convertDateIcuToPhp()` now converts `a` ICU symbols to `A` (brandonkelly)

View File

@ -185,7 +185,7 @@ class BaseFormatConverter
'cccc' => 'l', 'cccc' => 'l',
'ccccc' => '', 'ccccc' => '',
'cccccc' => '', '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 '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 '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 'H' => 'G', // 24-hour format of an hour without leading zeros 0 to 23h

View File

@ -45,13 +45,13 @@ class FormatConverterTest extends TestCase
public function testEscapedIcuToPhp() 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\'')); $this->assertEquals('\\o\\\'\\c\\l\\o\\c\\k', FormatConverter::convertDateIcuToPhp('\'o\'\'clock\''));
} }
public function testEscapedIcuToJui() 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\'')); $this->assertEquals('\'o\'\'clock\'', FormatConverter::convertDateIcuToJui('\'o\'\'clock\''));
} }