Fix PHP8 warning

This commit is contained in:
Aleksander Machniak 2023-07-13 12:27:07 +02:00
parent 83d5c9f7f5
commit dae51e28a1

View file

@ -1545,6 +1545,10 @@ class libcalendaring extends rcube_plugin
*/ */
public static function to_php_date_format($from) public static function to_php_date_format($from)
{ {
if (!is_string($from)) {
return '';
}
// "dd.MM.yyyy HH:mm:ss" => "d.m.Y H:i:s" // "dd.MM.yyyy HH:mm:ss" => "d.m.Y H:i:s"
return strtr(strtr($from, array( return strtr(strtr($from, array(
'YYYY' => 'Y', 'YYYY' => 'Y',
@ -1581,6 +1585,10 @@ class libcalendaring extends rcube_plugin
*/ */
public static function from_php_date_format($from) public static function from_php_date_format($from)
{ {
if (!is_string($from)) {
return '';
}
// "d.m.Y H:i:s" => "dd.MM.yyyy HH:mm:ss" // "d.m.Y H:i:s" => "dd.MM.yyyy HH:mm:ss"
return strtr($from, array( return strtr($from, array(
'y' => 'YY', 'y' => 'YY',