Skip to content

Commit

Permalink
a => A (fixes yiisoft#15380)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Dec 18, 2017
1 parent 339f129 commit 6ab93bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down
2 changes: 1 addition & 1 deletion framework/helpers/BaseFormatConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/helpers/FormatConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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\''));
}

Expand Down

0 comments on commit 6ab93bd

Please sign in to comment.