From: Bart Visscher Date: Wed, 30 Nov 2011 20:13:26 +0000 (+0100) Subject: Calendar: Also check if the enddate is in the requested range for events X-Git-Tag: v3.0~83^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0bbeb13e260caf97cb1029c66482101e839e6f32;p=nextcloud-server.git Calendar: Also check if the enddate is in the requested range for events --- diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index 770df8b63df..b0164690429 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -43,10 +43,12 @@ class OC_Calendar_Object{ public static function allInPeriod($id, $start, $end){ $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*calendar_objects WHERE calendarid = ?' .' AND ((startdate >= ? AND startdate <= ? AND repeating = 0)' + .' OR (enddate >= ? AND enddate <= ? AND repeating = 0)' .' OR (startdate <= ? AND repeating = 1))' ); $start = self::getUTCforMDB($start); $end = self::getUTCforMDB($end); $result = $stmt->execute(array($id, + $start, $end, $start, $end, $end));