TaskFieldHandler::getDeadlineMatchWorkTime

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. TaskFieldHandler
  4. getDeadlineMatchWorkTime
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/control/handler/taskfieldhandler.php
  • Класс: BitrixTasksControlHandlerTaskFieldHandler
  • Вызов: TaskFieldHandler::getDeadlineMatchWorkTime
private function getDeadlineMatchWorkTime($deadline)
{
	$resultDeadline = DateTime::createFromUserTimeGmt($deadline);

	$calendar = new UtilCalendar();
	if (!$calendar->isWorkTime($resultDeadline))
	{
		$resultDeadline = $calendar->getClosestWorkTime($resultDeadline);
	}

	$resultDeadline = $resultDeadline->convertToLocalTime()->getTimestamp();
	$resultDeadline = DateTime::createFromTimestamp($resultDeadline - UtilUser::getTimeZoneOffsetCurrentUser());

	return $resultDeadline;
}

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