Task::getRecountedGroupDeadline

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Task
  4. getRecountedGroupDeadline
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/copy/implement/task.php
  • Класс: BitrixTasksCopyImplementTask
  • Вызов: Task::getRecountedGroupDeadline
private function getRecountedGroupDeadline($currentDeadline, $taskCreatedDate)
{
	try
	{
		$startPoint = $this->projectTerm["start_point"];
		$startPointTime = TasksDateTime::createFrom($startPoint);

		$createdDate = TasksDateTime::createFrom($taskCreatedDate);
		$createdDate->setTime(0, 0);
		$currentDeadlineTime = TasksDateTime::createFrom($currentDeadline);
		$interval = $currentDeadlineTime->getTimestamp() - $createdDate->getTimestamp();
		if ($interval < 0)
		{
			return '';
		}

		$startPointTime->add('PT' . $interval . 'S');

		$phpDateTimeFormat = DateTime::convertFormatToPhp(FORMAT_DATETIME);
		return $startPointTime->format($phpDateTimeFormat);
	}
	catch (Exception $exception)
	{
		$this->result->addError(new Error($exception->getMessage(), self::TASK_COPY_ERROR));
		return "";
	}
}

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