From 7ccc7adadf5fb7c6611d4d74fff5c0c5b2fbc9ec Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 6 Apr 2011 08:04:43 +0000 Subject: [PATCH] fixed recurring events with enddate are on recurrence short in AS enddate in EGroupware or iCal is only a date, but AS needs a time incl. correct starttime --- calendar/inc/class.calendar_activesync.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_activesync.inc.php b/calendar/inc/class.calendar_activesync.inc.php index df41d53743..25b5e09d74 100644 --- a/calendar/inc/class.calendar_activesync.inc.php +++ b/calendar/inc/class.calendar_activesync.inc.php @@ -825,7 +825,13 @@ class calendar_activesync implements activesync_plugin_write $recurrence->monthofyear = (int)$rrule->time->format('m'); // 1..12 break; } - if ($rrule->enddate) $recurrence->until = $rrule->enddate->format('server'); + if ($rrule->enddate) // enddate is only a date, but AS needs a time incl. correct starttime! + { + $enddate = clone $rrule->time; + $enddate->setDate($rrule->enddate->format('Y'), $rrule->enddate->format('m'), + $rrule->enddate->format('d')); + $recurrence->until = $enddate->format('server'); + } if ($rrule->exceptions) { @@ -953,7 +959,7 @@ class calendar_activesync implements activesync_plugin_write if (!isset($this->calendar)) $this->calendar = new calendar_boupdate(); $ctag = $this->calendar->get_ctag($owner); // workaround for syncstate = 0 when calendar is empty causes synctate to not return 0 but array resulting in foldersync loop - if ($ctag == 0) $ctag = 1; + if ($ctag == 0) $ctag = 1; $changes = array(); // no change $syncstate_was = $syncstate;