Exclude dateless tasks from calendar API

This commit is contained in:
Lauri Niskanen 2021-02-21 09:10:52 +02:00
parent 3d82c9abbd
commit 3766670fa6
No known key found for this signature in database
GPG Key ID: 807DCEAC3AEB1848

View File

@ -37,12 +37,15 @@ class CalendarService extends BaseService
foreach ($this->getTasksService()->GetCurrent() as $currentTaskEntry) foreach ($this->getTasksService()->GetCurrent() as $currentTaskEntry)
{ {
$taskEvents[] = [ if (!empty($currentTaskEntry->due_date))
'title' => $titlePrefix . $currentTaskEntry->name, {
'start' => $currentTaskEntry->due_date, $taskEvents[] = [
'date_format' => 'date', 'title' => $titlePrefix . $currentTaskEntry->name,
'link' => $this->UrlManager->ConstructUrl('/tasks') 'start' => $currentTaskEntry->due_date,
]; 'date_format' => 'date',
'link' => $this->UrlManager->ConstructUrl('/tasks')
];
}
} }
} }