From d82ca7378b373e92b71e7ee9bf6367a1bb6eb0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Tue, 5 Jan 2010 18:06:07 +0000 Subject: [PATCH] Fix recur_enddate during import/export --- calendar/inc/class.calendar_ical.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index bf2a21503f..a3e5316d74 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -248,17 +248,15 @@ class calendar_ical extends calendar_boupdate } elseif ($event['recur_enddate']) { - $time = new egw_time($event['start'],egw_time::$server_timezone); + $time = new egw_time($event['recur_enddate'],egw_time::$server_timezone); if (!isset(self::$tz_cache[$event['tzid']])) { self::$tz_cache[$event['tzid']] = calendar_timezones::DateTimeZone($event['tzid']); } // all calculations in the event's timezone $time->setTimezone(self::$tz_cache[$event['tzid']]); - $time->setTime(0, 0, 0); - $delta = $event['end'] - (int)$time->format('U'); - // Adjust recur_enddate to end time - $event['recur_enddate'] += $delta; + $time->setTime(23, 59, 59); + $event['recur_enddate'] = $this->date2ts($time); } if ($this->log) error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n".array2string($event)."\n",3,$this->logfile); @@ -2122,6 +2120,8 @@ class calendar_ical extends calendar_boupdate $last = clone $rriter->current; $rriter->next_no_exception(); } + $delta = $event['end'] - $event['start']; + $last->modify('+' . $delta . ' seconds'); $last->setTime(0, 0, 0); $event['recur_enddate'] = $this->date2ts($last); }