fix(dashboard): skip events without DTEND

Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
Anna Larch 2025-08-27 11:42:16 +02:00
parent e7f8d5611d
commit 36ee1ac7dc
2 changed files with 22 additions and 0 deletions

View file

@ -91,6 +91,11 @@ class CalendarIntegrationService {
$dashboardEvent = new Event();
foreach ($calendarEvent['objects'] as $object) {
if (!isset($object['DTEND'][0])) {
// Don't show events without end since they should not take up any time
// @link https://www.kanzaki.com/docs/ical/vevent.html
continue;
}
$dashboardEvent->setStart(\DateTime::createFromImmutable($object['DTSTART'][0])->setTimezone($userTimezone)->getTimestamp());
$dashboardEvent->setEnd(\DateTime::createFromImmutable($object['DTEND'][0])->setTimezone($userTimezone)->getTimestamp());
// Filter out events in the past

View file

@ -0,0 +1,17 @@
BEGIN:VCALENDAR
PRODID:-//IDN nextcloud.com//Calendar app 5.2.0-dev.1//EN
CALSCALE:GREGORIAN
VERSION:2.0
BEGIN:VEVENT
CREATED:20250310T171800Z
DTSTAMP:20250310T171819Z
LAST-MODIFIED:20250310T171819Z
SEQUENCE:2
UID:{{{UID}}}
DTSTART:{{{START}}}
STATUS:CONFIRMED
SUMMARY:{{{NAME}}}-no-end
LOCATION:{{{LOCATION}}}
DESCRIPTION:{{{NAME}}}
END:VEVENT
END:VCALENDAR