Calendar: Fix repeating events

This commit is contained in:
Bart Visscher 2012-05-03 23:33:44 +02:00
parent 89c8316f8f
commit 07ff1e723a
2 changed files with 5 additions and 2 deletions

View File

@ -19,6 +19,6 @@ $events = OC_Calendar_App::getrequestedEvents($_GET['calendar_id'], $start, $end
$output = array();
foreach($events as $event){
$output[] = OC_Calendar_App::generateEventOutput($event, $start, $end);
$output = $output + OC_Calendar_App::generateEventOutput($event, $start, $end);
}
OCP\JSON::encodedPrint($output);

View File

@ -392,6 +392,7 @@ class OC_Calendar_App{
}
}
$return = array();
if($event['repeating'] == 1){
$duration = (double) $end_dt->format('U') - (double) $start_dt->format('U');
$r = new When();
@ -422,6 +423,7 @@ class OC_Calendar_App{
$output['start'] = $result->format('Y-m-d H:i:s');
$output['end'] = date('Y-m-d H:i:s', $result->format('U') + $duration);
}
$return[] = $output;
}
}else{
if($output['allDay'] == true){
@ -432,7 +434,8 @@ class OC_Calendar_App{
$output['start'] = $start_dt->format('Y-m-d H:i:s');
$output['end'] = $end_dt->format('Y-m-d H:i:s');
}
$return[] = $output;
}
return $output;
return $return;
}
}