fix for Call to a member function setTimezone() on a non-object; Dont Try to do a settimezone, when rrule[UNTIL] is no DateTime object

This commit is contained in:
Klaus Leithoff 2010-06-21 09:56:50 +00:00
parent 4d15d698b1
commit c94bf30cb8

View File

@ -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')