Merge pull request #12578 from MrPetovan/bug/warnings

Add new case to DateTimeFormat::fix
This commit is contained in:
Philipp 2022-12-31 10:08:13 +01:00 committed by GitHub
commit fefe9cd5c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -182,8 +182,8 @@ class DateTimeFormat
*/ */
public static function fix(string $dateString): string public static function fix(string $dateString): string
{ {
$search = ['Mär', 'März', 'Mai', 'Juni', 'Juli', 'Okt', 'Dez', 'ET' , 'ZZ', ' - ', '+']; $search = ['Mär', 'März', 'Mai', 'Juni', 'Juli', 'Okt', 'Dez', 'ET' , 'ZZ', ' - ', '+', ' (Coordinated Universal Time)'];
$replace = ['Mar', 'Mar' , 'May', 'Jun' , 'Jul' , 'Oct', 'Dec', 'EST', 'Z' , ', ' , '+' ]; $replace = ['Mar', 'Mar' , 'May', 'Jun' , 'Jul' , 'Oct', 'Dec', 'EST', 'Z' , ', ' , '+' , ''];
$dateString = str_replace($search, $replace, $dateString); $dateString = str_replace($search, $replace, $dateString);

View File

@ -126,6 +126,10 @@ class DateTimeFormatTest extends MockedTest
'German date time string' => [ 'German date time string' => [
'expectedDate' => '2022-10-05T16:34:00+02:00', 'expectedDate' => '2022-10-05T16:34:00+02:00',
'dateString' => '05 Okt 2022 16:34:00 +0200', 'dateString' => '05 Okt 2022 16:34:00 +0200',
],
'(Coordinated Universal Time)' => [
'expectedDate' => '2022-12-30T14:29:10+00:00',
'dateString' => 'Fri Dec 30 2022 14:29:10 GMT+0000 (Coordinated Universal Time)',
] ]
]; ];
} }