could::shiftDates

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. could
  4. shiftDates
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/processor/task/scheduler/result/impact.php
  • Класс: BitrixTasksProcessorTaskSchedulerResultcould
  • Вызов: could::shiftDates
public function shiftDates($offset)
{
	$offset = intval($offset);
	if($offset)
	{
		/**
		 * @var DateTime $start
		 */
		$start = clone $this['START_DATE_PLAN'];
		/**
		 * @var DateTime $end
		 */
		$end = clone $this['END_DATE_PLAN'];

		if(!is_object($start) || !is_object($end))
		{
			// it is an infinite task, ignore it
			return;
		}

		$sign = $offset > 0 ? '' : '-';
		$start = $start->add($sign.'T'.abs($offset).'S');
		$end = $end->add($sign.'T'.abs($offset).'S');

		$this->setDataUpdated(array(
			'START_DATE_PLAN' => $start,
			'END_DATE_PLAN' => $end
		));
	}
}

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