OccupancyChecker::getEventTimestamps

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. OccupancyChecker
  4. getEventTimestamps
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/rooms/occupancychecker.php
  • Класс: BitrixCalendarRoomsOccupancyChecker
  • Вызов: OccupancyChecker::getEventTimestamps
private function getEventTimestamps(array $event): array
{
	$dateFrom = new DateTime($event['DATE_FROM']);
	$dateTo = new DateTime($event['DATE_TO']);
	$timezoneFrom = $event['TZ_FROM'] ?? null;
	$timezoneTo = $event['TZ_TO'] ?? null;
	$timestampFrom = BitrixCalendarUtil::getDateTimestampUtc($dateFrom, $timezoneFrom);
	$timestampTo = BitrixCalendarUtil::getDateTimestampUtc($dateTo, $timezoneTo);
	if (($timestampFrom === $timestampTo) || (($event['DT_SKIP_TIME'] ?? null) === 'Y'))
	{
		$timestampTo += CCalendar::GetDayLen();
	}

	//This is done to check weak inequality
	$timestampFrom++;
	$timestampTo--;

	return [$timestampFrom, $timestampTo];
}

Добавить комментарий