mirror of
https://github.com/friendica/friendica
synced 2024-11-14 04:22:55 +00:00
Merge pull request #12641 from MrPetovan/bug/warnings
Add yet another case to DateTimeFormat::fix
This commit is contained in:
commit
69a9c2c618
2 changed files with 6 additions and 2 deletions
|
@ -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', ' - ', '+', ' (Coordinated Universal Time)'];
|
$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);
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,10 @@ class DateTimeFormatTest extends MockedTest
|
||||||
'(Coordinated Universal Time)' => [
|
'(Coordinated Universal Time)' => [
|
||||||
'expectedDate' => '2022-12-30T14:29:10+00:00',
|
'expectedDate' => '2022-12-30T14:29:10+00:00',
|
||||||
'dateString' => 'Fri Dec 30 2022 14:29:10 GMT+0000 (Coordinated Universal Time)',
|
'dateString' => 'Fri Dec 30 2022 14:29:10 GMT+0000 (Coordinated Universal Time)',
|
||||||
|
],
|
||||||
|
'Double HTML encode' => [
|
||||||
|
'expectedDate' => '2015-05-22T08:48:00+12:00',
|
||||||
|
'dateString' => '2015-05-22T08:48:00+12:00'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue