diff --git a/Services/Calendar/classes/iCal/class.ilICalParser.php b/Services/Calendar/classes/iCal/class.ilICalParser.php index 2c48b30047e8..d8a7ed200c61 100644 --- a/Services/Calendar/classes/iCal/class.ilICalParser.php +++ b/Services/Calendar/classes/iCal/class.ilICalParser.php @@ -1,7 +1,5 @@ @@ -393,6 +392,17 @@ protected function writeEvent(): void } $entry->save(); + // Search exclusions + // Only possible after entry is saved, otherwise the id is not available + foreach ($this->getContainer()->getItemsByName('EXDATE', false) as $item) { + if (is_a($item, 'ilICalProperty')) { + $rec_exclusion = new ilCalendarRecurrenceExclusion(); + $rec_exclusion->setEntryId($entry->getEntryId()); + $rec_exclusion->setDate(new ilDate($item->getValue(), IL_CAL_DATE)); + $rec_exclusion->save(); + } + } + $ass = new ilCalendarCategoryAssignments($entry->getEntryId()); $ass->addAssignment($this->category->getCategoryID());