From: Georg Ehrke Date: Mon, 11 Jun 2012 13:36:48 +0000 (+0200) Subject: some fixes for repeating events caching X-Git-Tag: v4.5.0beta1~74^2~407^2~40 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32b366585db05fce17e6e99e53445fa15f341611;p=nextcloud-server.git some fixes for repeating events caching --- 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'));