Merge pull request #12973 from nupplaphil/bug/datetimeformat
Fix DateTimeFormat issue
This commit is contained in:
commit
e28179c855
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,11 @@ class DateTimeFormatTest extends MockedTest
|
||||||
'Double HTML encode' => [
|
'Double HTML encode' => [
|
||||||
'expectedDate' => '2015-05-22T08:48:00+12:00',
|
'expectedDate' => '2015-05-22T08:48:00+12:00',
|
||||||
'dateString' => '2015-05-22T08:48:00+12:00'
|
'dateString' => '2015-05-22T08:48:00+12:00'
|
||||||
]
|
],
|
||||||
|
'2023-04-02\T17:22:42+05:30' => [
|
||||||
|
'expectedDate' => '2023-04-02T17:22:42+05:30',
|
||||||
|
'dateString' => '2023-04-02\T17:22:42+05:30'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue