could::resetDates

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. could
  4. resetDates
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/processor/task/scheduler/result/impact.php
  • Класс: BitrixTasksProcessorTaskSchedulerResultcould
  • Вызов: could::resetDates
public function resetDates()
{
	$this->getDataPristine();

	$startDatePlanSet = (string) $this['START_DATE_PLAN'] != '';
	$endDatePlanSet = (string) $this['END_DATE_PLAN'] != '';

	$calendar = Calendar::getInstance();

	// set end date as the end of the day
	$this->setEndDatePlanUserTimeGmt($calendar->getEndOfCurrentDayGmt()->toStringGmt());

	if($this->getMatchWorkTime())
	{
		$duration = $this->calculateDuration();
		$secInHour = 3600;
		if($duration < $this->getDefaultDuration() * $secInHour)
		{
			$duration = $this->getDefaultDuration() * $secInHour;
		}

		$startDate = $this->getStartDatePlanGmt(true);

		if(!$startDatePlanSet)
		{
			$this->setStartDatePlanUserTimeGmt($calendar->getClosestWorkTime($startDate, true)->toStringGmt());
		}
		if(!$endDatePlanSet)
		{
			$this->setEndDatePlanUserTimeGmt($calendar->calculateEndDate($startDate, $duration)->toStringGmt());
		}
	}
}

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