summaryrefslogtreecommitdiff
path: root/plugins/calendar/lib/calendar_recurrence.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2012-11-02 15:25:25 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2012-11-02 15:25:25 (GMT)
commit728a28c5e9c5cafd639a5357d2bf40280a35633f (patch)
tree09cdeee8e5b735666fec865064a725de91b95cb8 /plugins/calendar/lib/calendar_recurrence.php
parent1d18e0a064d77b79c824e1f24bb6cc752ca07c80 (diff)
downloadroundcubemail-plugins-kolab-728a28c5e9c5cafd639a5357d2bf40280a35633f.tar.gz
Fix recurrence computation with UMTIL date
Diffstat (limited to 'plugins/calendar/lib/calendar_recurrence.php')
-rw-r--r--plugins/calendar/lib/calendar_recurrence.php12
1 files changed, 3 insertions, 9 deletions
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;
}