Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
excludedateshandler.php
1<?php
2
4
5use Bitrix\Calendar\Core;
8
10{
17 public function prepareEventExcludeDates(Event $event, ?Core\Base\Map $exceptionEvents)
18 {
19 if (
20 $exceptionEvents === null
21 || $exceptionEvents->count() === 0
22 || !$event->getExcludedDateCollection()
23 || $event->getExcludedDateCollection()->count() === 0
24 )
25 {
26 return;
27 }
28
30 foreach ($event->getExcludedDateCollection() as $key => $date)
31 {
32 if ($exceptionEvents->has($date->format('Ymd')))
33 {
34 $event->getExcludedDateCollection()->remove($key);
35 }
36 }
37 }
38}