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

@@ -74,6 +74,7 @@
- Fixed that the endpoint `/objects/{entity}/{objectId}` always returned successfully, even when the given object not exists (now returns `404` when the object is not found) (thanks @fipwmaqzufheoxq92ebc)
- Fixed that the endpoint `/stock/volatile` didn't include products which expire today (thanks @fipwmaqzufheoxq92ebc)
- Fixed that the endpoint `/objects/{entity}` did not include Userfields for Userentities (so the effective endpoint `/objects/userobjects`)
- Endpoint `/calendar/ical`: Fixed that "Track date only"-chores were always set to happen at 12am (are treated as all-day events now)
- Fixed (again) that CORS was broken
### General & other improvements/fixes

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);