diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 6cb82f64ef..da0dea8883 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -611,8 +611,14 @@ class calendar_ical extends calendar_boupdate { self::$tz_cache['UTC'] = calendar_timezones::DateTimeZone('UTC'); } - $rrule['UNTIL']->setTimezone(self::$tz_cache['UTC']); - $rrule['UNTIL'] = $rrule['UNTIL']->format('Ymd\THis\Z'); + //error_log(__METHOD__.array2string($rrule)); + //error_log(__METHOD__.array2string(self::$tz_cache['UTC'])); + if (is_a($rrule['UNTIL'],'DateTime')) + { + $rrule['UNTIL']->setTimezone(self::$tz_cache['UTC']); + $rrule['UNTIL'] = $rrule['UNTIL']->format('Ymd\THis\Z'); + } + //error_log(__METHOD__.array2string($rrule)); } } if ($version == '1.0') @@ -3105,4 +3111,4 @@ class calendar_ical extends calendar_boupdate return $vcal->exportvCalendar($charset); } -} \ No newline at end of file +}