summaryrefslogtreecommitdiffstats
path: root/apps/calendar/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-11-30 21:13:26 +0100
committerBart Visscher <bartv@thisnet.nl>2011-11-30 21:13:26 +0100
commit0bbeb13e260caf97cb1029c66482101e839e6f32 (patch)
tree40a8c3438359c4231ec604ecbc885264ce88dc64 /apps/calendar/lib
parente5fdc6013a05268b5b61008ed420cacc0a9d0422 (diff)
downloadnextcloud-server-0bbeb13e260caf97cb1029c66482101e839e6f32.tar.gz
nextcloud-server-0bbeb13e260caf97cb1029c66482101e839e6f32.zip
Calendar: Also check if the enddate is in the requested range for events
Diffstat (limited to 'apps/calendar/lib')
-rw-r--r--apps/calendar/lib/object.php2
1 files changed, 2 insertions, 0 deletions
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,11 +43,13 @@ 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));
$calendarobjects = array();