]> source.dussan.org Git - nextcloud-server.git/commitdiff
Calendar: Also check if the enddate is in the requested range for events
authorBart Visscher <bartv@thisnet.nl>
Wed, 30 Nov 2011 20:13:26 +0000 (21:13 +0100)
committerBart Visscher <bartv@thisnet.nl>
Wed, 30 Nov 2011 20:13:26 +0000 (21:13 +0100)
apps/calendar/lib/object.php

index 770df8b63df8b408452b2a10ccfb737708c5258f..b0164690429af90b567cb21291b6ed8fe4b01780 100644 (file)
@@ -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));