Display "Track date only"-chores as all-day also in iCal API endpoint (references #941)

This commit is contained in:
Bernd Bestel
2020-09-01 19:32:28 +02:00
parent 2bc3b53c63
commit 60f3d900e8
2 changed files with 9 additions and 2 deletions

View File

@@ -22,12 +22,18 @@ class CalendarApiController extends BaseApiController
$date->setTime(23, 59, 59);
}
$description = '';
if (isset($event['description']))
{
$description = $event['description'];
}
$vEvent = new \Eluceo\iCal\Component\Event();
$vEvent->setDtStart($date)
->setDtEnd($date)
->setSummary($event['title'])
->setDescription($event['description'])
->setNoTime($event['date_format'] === 'date')
->setDescription($description)
->setNoTime($event['date_format'] === 'date' || (isset($event['allDay']) && $event['allDay']))
->setUseTimezone(true);
$vCalendar->addComponent($vEvent);