Also consider exceptions when checking if first instance is to be listed (#2625)
This commit is contained in:
parent
be12aa5827
commit
f1dce1f5b9
1 changed files with 11 additions and 2 deletions
|
@ -267,9 +267,18 @@ class kolab_calendar
|
|||
$add = true;
|
||||
|
||||
// skip the first instance of a recurring event if listed in exdate
|
||||
if ($virtual && !empty($event['recurrence']['EXDATE'])) {
|
||||
if ($virtual && (!empty($event['recurrence']['EXDATE']) || !empty($event['recurrence']['EXCEPTIONS']))) {
|
||||
$event_date = $event['start']->format('Ymd');
|
||||
foreach ($event['recurrence']['EXDATE'] as $exdate) {
|
||||
$exdates = (array)$event['recurrence']['EXDATE'];
|
||||
|
||||
// add dates from exceptions to list
|
||||
if (is_array($event['recurrence']['EXCEPTIONS'])) {
|
||||
foreach ($event['recurrence']['EXCEPTIONS'] as $exception) {
|
||||
$exdates[] = clone $exception['start'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($exdates as $exdate) {
|
||||
if ($exdate->format('Ymd') == $event_date) {
|
||||
$add = false;
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue