fix PHP 8.0 TypeError: Unsupported operand types: EGroupware\Api\DateTime + int

This commit is contained in:
Ralf Becker 2021-11-08 10:55:45 +01:00
parent dba803fff5
commit a7796d8f27

View File

@ -1663,6 +1663,10 @@ ORDER BY cal_user_type, cal_usre_id
// check if recurrence enddate was adjusted
if(isset($event['recur_enddate']))
{
if (is_object($event['recur_enddate']))
{
$event['recur_enddate'] = Api\DateTime::user2server($event['recur_enddate'], 'ts');
}
// recurrences need to be truncated
if((int)$event['recur_enddate'] > 0 &&
((int)$old_repeats['recur_enddate'] == 0 || (int)$old_repeats['recur_enddate'] > (int)$event['recur_enddate'])