• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/model/schedule/shift/shift.php
  • Класс: BitrixTimemanModelScheduleShiftShift
  • Вызов: Shift::isForTime
public function isForTime($seconds, $offset = 0)
{
	if ($offset < 0)
	{
		$offset = 0;
	}
	$allowedStart = $this->normalizeSeconds($this->getWorkTimeStart() - $offset);
	if ($allowedStart <= $this->getWorkTimeEnd())
	{
		return $seconds >= $allowedStart && $seconds <= $this->getWorkTimeEnd();
	}
	if ($seconds >= $allowedStart && $seconds <= TimeDictionary::SECONDS_PER_DAY)
	{
		return true;
	}
	if ($seconds >= 0 && $seconds <= $this->getWorkTimeEnd())
	{
		return true;
	}

	return false;
}