• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/processor/task/scheduler/result/impact.php
  • Класс: BitrixTasksProcessorTaskSchedulerResultis
  • Вызов: is::calculateDuration
public function calculateDuration()
{
	if (!$this->getStartDatePlan(true) ||
		!$this->getStartDatePlanGmt(true) ||
		!$this->getEndDatePlan() ||
		!$this->getEndDatePlanGmt()) // start date or end date is null
	{
		return 0;
	}

	if ($this->getMatchWorkTime())
	{
		$duration = Calendar::getInstance()->calculateDuration($this->getStartDatePlanGmt(true), $this->getEndDatePlanGmt());
		return ($duration > 0 ? $duration : $this->getEndDatePlanGmt()->getTimestamp() - $this->getStartDatePlanGmt(true)->getTimestamp());
	}
	else
	{
		return ($this->getEndDatePlanGmt()->getTimestamp() - $this->getStartDatePlanGmt(true)->getTimestamp());
	}
}