diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-06-11 15:36:48 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-06-11 15:36:48 +0200 |
commit | 32b366585db05fce17e6e99e53445fa15f341611 (patch) | |
tree | 30ee734c2dc70607c5a1e171371d55bde8fb9244 /apps/calendar/lib/repeat.php | |
parent | e6c8febafce03ccae90e280803842ea18a3a62db (diff) | |
download | nextcloud-server-32b366585db05fce17e6e99e53445fa15f341611.tar.gz nextcloud-server-32b366585db05fce17e6e99e53445fa15f341611.zip |
some fixes for repeating events caching
Diffstat (limited to 'apps/calendar/lib/repeat.php')
-rw-r--r-- | apps/calendar/lib/repeat.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/calendar/lib/repeat.php b/apps/calendar/lib/repeat.php index 36e56a2f709..f1323a9cb5e 100644 --- a/apps/calendar/lib/repeat.php +++ b/apps/calendar/lib/repeat.php @@ -84,14 +84,14 @@ class OC_Calendar_Repeat{ * @return (bool) */ public static function generate($id){ - $event = OC_Calendar_Object::find(id); + $event = OC_Calendar_Object::find($id); if($event['repeating'] == 0){ return false; } $object = OC_VObject::parse($event['calendardata']); - $start = new DateTime('first day of this year', new DateTimeZone('UTC')); + $start = new DateTime('first day of January ' . date('Y') . ' 00:00:00', new DateTimeZone('UTC')); $start->modify('-5 years'); - $end = new DateTime('last day of this year', new DateTimeZone('UTC')); + $end = new DateTime('last day of December ' . date('Y') . ' 23:59:59', new DateTimeZone('UTC')); $end->modify('+5 years'); $object->expand($start, $end); foreach($object->getComponents() as $vevent){ @@ -104,6 +104,7 @@ class OC_Calendar_Repeat{ $end_dt = $dtend->getDateTime(); if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE){ $startdate = $start_dt->format('Y-m-d'); + $end_dt->modify('-1 sec'); $enddate = $end_dt->format('Y-m-d'); }else{ $start_dt->setTimezone(new DateTimeZone('UTC')); |