mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
fix(dashboard): skip events without DTEND
Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
parent
e7f8d5611d
commit
36ee1ac7dc
2 changed files with 22 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
17
tests/integration/spreedcheats/calendars/6_event_no_end.txt
Normal file
17
tests/integration/spreedcheats/calendars/6_event_no_end.txt
Normal 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
|
||||
Loading…
Add table
Reference in a new issue