Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/php-8.1-strftime.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function strftime (string $format, $timestamp = null, ?string $locale = null) :
'%A' => 'EEEE', // A full textual representation of the day Sunday through Saturday
'%b' => 'LLL', // Abbreviated month name, based on the locale Jan through Dec
'%B' => 'MMMM', // Full month name, based on the locale January through December
'%h' => 'MMM', // Abbreviated month name, based on the locale (an alias of %b) Jan through Dec
'%h' => 'LLL', // Abbreviated month name, based on the locale (an alias of %b) Jan through Dec
];

$intl_formatter = function (DateTimeInterface $timestamp, string $format) use ($intl_formats, $locale) {
Expand Down
3 changes: 3 additions & 0 deletions tests/strftimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public function testMonthFormats () {
$result = strftime('%h', '20220306 13:02:03', 'en-EN');
$this->assertEquals('Mar', $result, '%h: Abbreviated month name, based on the locale (an alias of %b)');

$result = strftime('%h', '20220706 13:02:03', 'de-DE');
$this->assertEquals(strftime('%b', '20220706 13:02:03', 'de-DE'), $result, '%h: Abbreviated month name, based on the locale (an alias of %b)');

$result = strftime('%m', '20220306 13:02:03');
$this->assertEquals('03', $result, '%m: Two digit representation of the month');
}
Expand Down
Loading