add list of task

This commit is contained in:
2018-04-17 21:57:56 +02:00
parent fd8b6490d0
commit 9dfa39ff07
6 changed files with 298 additions and 4 deletions

View File

@@ -142,6 +142,28 @@ class SingleTask extends AbstractTask
return $this->warningInterval;
}
/**
* Get the Warning date, computed from the difference between the
* end date and the warning interval
*
* Return null if warningDate or endDate is null
*
* @return \DateTimeImmutable
*/
public function getWarningDate()
{
if ($this->getWarningInterval() === null) {
return null;
}
if ($this->getEndDate() === null) {
return null;
}
return \DateTimeImmutable::createFromMutable($this->getEndDate())
->sub($this->getWarningInterval());
}
function getRecurringTask(): RecurringTask
{
return $this->recurringTask;