diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/calendar/drivers/kolab/kolab_calendar.php | 4 | ||||
-rw-r--r-- | plugins/calendar/drivers/kolab/kolab_driver.php | 5 | ||||
-rw-r--r-- | plugins/calendar/lib/Horde_Date_Recurrence.php | 5 | ||||
-rw-r--r-- | plugins/calendar/lib/calendar_recurrence.php | 12 |
4 files changed, 12 insertions, 14 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_calendar.php b/plugins/calendar/drivers/kolab/kolab_calendar.php index b7a1bc8..84f7dca 100644 --- a/plugins/calendar/drivers/kolab/kolab_calendar.php +++ b/plugins/calendar/drivers/kolab/kolab_calendar.php @@ -532,8 +532,8 @@ class kolab_calendar if ($recurrence['range-type'] == 'number') $rrule['COUNT'] = intval($recurrence['range']); else if ($recurrence['range-type'] == 'date') { - $rrule['UNTIL'] = new DateTime('@'.$recurrence['range']); - $rrule['UNTIL']->setTimezone($this->cal->user_timezone); + $rrule['UNTIL'] = new DateTime('@' . $recurrence['range']); + $rrule['UNTIL']->setTimezone(new DateTimeZone(date_default_timezone_get())); } if ($recurrence['day']) { diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php index e470fe2..55b08a1 100644 --- a/plugins/calendar/drivers/kolab/kolab_driver.php +++ b/plugins/calendar/drivers/kolab/kolab_driver.php @@ -498,7 +498,7 @@ class kolab_driver extends calendar_driver // removing the first instance => just move to next occurence if ($master['id'] == $event['id']) { - $recurring = reset($storage->_get_recurring_events($event, $event['start'], $event['end'] + 86400 * 370, $event['id'].'-1')); + $recurring = reset($storage->_get_recurring_events($event, $event['start']->format('U'), $event['end']->format('U') + 86400 * 370, $event['id'].'-1')); $master['start'] = $recurring['start']; $master['end'] = $recurring['end']; if ($master['recurrence']['COUNT']) @@ -515,7 +515,8 @@ class kolab_driver extends calendar_driver $_SESSION['calendar_restore_event_data'] = $master; // set until-date on master event - $master['recurrence']['UNTIL'] = $event['start'] - 86400; + $master['recurrence']['UNTIL'] = clone $event['start']; + $master['recurrence']['UNTIL']->modify('-1 day'); unset($master['recurrence']['COUNT']); $success = $storage->update_event($master); break; diff --git a/plugins/calendar/lib/Horde_Date_Recurrence.php b/plugins/calendar/lib/Horde_Date_Recurrence.php index 68340ba..d6debf3 100644 --- a/plugins/calendar/lib/Horde_Date_Recurrence.php +++ b/plugins/calendar/lib/Horde_Date_Recurrence.php @@ -6307,7 +6307,10 @@ class Horde_Date_Recurrence { '%04d%02d%02d'); $this->setRecurEnd(new Horde_Date(array('year' => $year, 'month' => $month, - 'mday' => $mday))); + 'mday' => $mday, + 'hour' => 23, + 'min' => 59, + 'sec' => 59))); } if (isset($rdata['COUNT'])) { $this->setRecurCount($rdata['COUNT']); diff --git a/plugins/calendar/lib/calendar_recurrence.php b/plugins/calendar/lib/calendar_recurrence.php index ce1738b..51a0fdd 100644 --- a/plugins/calendar/lib/calendar_recurrence.php +++ b/plugins/calendar/lib/calendar_recurrence.php @@ -53,14 +53,8 @@ class calendar_recurrence // TODO: replace with something that has less than 6'000 lines of code require_once($this->cal->home . '/lib/Horde_Date_Recurrence.php'); - // shift until date by one day in order to trick the Horde_Date_Recurrence computation - if ($event['recurrence']['UNTIL']) { - $event['recurrence']['UNTIL'] = clone $event['recurrence']['UNTIL']; - $event['recurrence']['UNTIL']->modify('+1 day'); - } - $this->event = $event; - $this->engine = new Horde_Date_Recurrence($dtstart->format('U')); + $this->engine = new Horde_Date_Recurrence($dtstart->format('Y-m-d H:i:s')); $this->engine->fromRRule20(calendar::to_rrule($event['recurrence'])); if (is_array($event['recurrence']['EXDATE'])) { @@ -69,7 +63,7 @@ class calendar_recurrence } $this->tz_offset = $event['allday'] ? $this->cal->gmt_offset - date('Z') : 0; - $this->next = new Horde_Date($dtstart->format('U')); + $this->next = new Horde_Date($dtstart->format('Y-m-d H:i:s')); $this->hour = $this->next->hour; } @@ -87,7 +81,7 @@ class calendar_recurrence $next->hour = $this->hour; $next->min = 0; } - $time = new DateTime($next->iso8601DateTime(), $this->cal->user_timezone); + $time = new DateTime($next->rfc3339DateTime(), $this->cal->user_timezone); $this->next = $next; } |