fix: preserve all-day event dates in Nextcloud calendar integration (#5523)

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-04-17 10:53:43 +02:00
1 parent 88591d973f
commit 2e789795ed
1 file changed
+8 -2
@@ -113,7 +113,9 @@ export class NextcloudIntegration extends Integration implements ICalendarIntegr
// next actually returns undefined when there are no more occurrences
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((next = iterator.next())) {
const nextStartDate = next.convertToZone(ICAL.Timezone.utcTimezone).toJSDate();
const nextStartDate = next.isDate
? next.toJSDate()
: next.convertToZone(ICAL.Timezone.utcTimezone).toJSDate();
if (nextStartDate > end) break;
const nextEndDate = new Date(nextStartDate.getTime() + durationMs);
if (nextEndDate < start) continue;
@@ -121,7 +123,11 @@ export class NextcloudIntegration extends Integration implements ICalendarIntegr
startDates.push(nextStartDate);
}
} else {
startDates = [veventObject.startDate.convertToZone(ICAL.Timezone.utcTimezone).toJSDate()];
startDates = [
veventObject.startDate.isDate
? veventObject.startDate.toJSDate()
: veventObject.startDate.convertToZone(ICAL.Timezone.utcTimezone).toJSDate(),
];
}
return startDates.map((startDate) => {