1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
excludeddatescollection.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Core\Event\Properties;
4
5use Bitrix\Calendar\Core\Base\Date;
6use Bitrix\Calendar\Core\Base\PropertyCollection;
7
8
10{
11 public const EXCLUDED_DATE_FORMAT = 'd.m.Y';
12
17 public function toString(string $separator = ';'): string
18 {
19 return implode(
20 $separator,
21 array_unique(
22 array_map(
23 fn (Date $date) => $date->format(\CCalendar::DFormat(false)),
24 $this->collection)
25 ));
26 }
27
32 public function getDateCollectionNewerThanInterval(string $interval = '1 month'): ExcludedDatesCollection
33 {
34 $timestamp = (new Date())->sub($interval)->getTimestamp();
35
36 $exdateCollection = new static();
37
39 foreach ($this->collection as $item)
40 {
41 if ($item->getTimestamp() > $timestamp)
42 {
43 $exdateCollection->add($item);
44 }
45 }
46
47 return $exdateCollection;
48 }
49
50 public function removeDateFromCollection(Date $date): void
51 {
52 foreach ($this->collection as $key => $item)
53 {
54 if ($item->format('d.m.Y') === $date->format('d.m.Y'))
55 {
56 unset($this->collection[$key]);
57 }
58 }
59 }
60}
Определения date.php:9
format($format)
Определения date.php:110
if(empty($signedUserToken)) $key
Определения quickway.php:257