From 0f00bb08a2e1b920be9ebded63fce1ee76e7e996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Fri, 11 Jun 2010 06:19:22 +0000 Subject: [PATCH] Set recurrence enddate to end time and use device TZ for vCalendar 1.0 --- calendar/inc/class.calendar_ical.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index afc330ef31..394967886d 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -347,7 +347,17 @@ class calendar_ical extends calendar_boupdate $time = new egw_time($event['recur_enddate'],egw_time::$server_timezone); // all calculations in the event's timezone $time->setTimezone(self::$tz_cache[$event['tzid']]); - $time->setTime(23, 59, 59); + if (empty($event['whole_day']) && !empty($event['end'])) + { + $end = new egw_time($event['end'],egw_time::$server_timezone); + $end->setTimezone(self::$tz_cache[$event['tzid']]); + $arr = egw_time::to($end,'array'); + $time->setTime($arr['hour'],$arr['minute'],$arr['second']); + } + else + { + $time->setTime(23, 59, 59); + } $event['recur_enddate'] = egw_time::to($time, 'server'); } @@ -613,6 +623,10 @@ class calendar_ical extends calendar_boupdate $rrule = $rriter->generate_rrule($version); if ($version == '1.0') { + if ($event['recur_enddate']) + { + $rrule['UNTIL'] = self::getDateTime($event['recur_enddate'],$tzid); + } $attributes['RRULE'] = $rrule['FREQ'].' '.$rrule['UNTIL']; } else // $version == '2.0'