Calendar: Also check if the enddate is in the requested range for events
This commit is contained in:
parent
e5fdc6013a
commit
0bbeb13e26
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue