mirror of
https://github.com/grocy/grocy.git
synced 2025-09-16 09:51:30 +00:00
Display "Track date only"-chores as all-day also in iCal API endpoint (references #941)
This commit is contained in:
@@ -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
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user