Calendar::setTimezones

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. Calendar
  4. setTimezones
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/ical/builder/calendar.php
  • Класс: BitrixCalendarICalBuilderCalendar
  • Вызов: Calendar::setTimezones
public function setTimezones($timezone): Calendar
{
	if (is_null($timezone)) {
		return $this;
	}

	$timezones = array_map(function ($eventToResolve) {
		if (! is_callable($eventToResolve)) {
			return $eventToResolve;
		}

		$newTimezone = new Timezone();

		$eventToResolve($newTimezone);

		return $newTimezone;
	}, is_array($timezone) ? $timezone : [$timezone]);

	$this->timezones = array_merge($this->timezones, $timezones);

	return $this;
}

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