Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default class ICSFeedCalendarService implements Calendar {
const userId = this.getUserId(selectedCalendars);
// we use the userId from selectedCalendars to fetch the user's timeZone from the database primarily for all-day events without any timezone information
const userTimeZone = userId ? await this.getUserTimezoneFromDB(userId) : "Europe/London";
const events: { start: string; end: string }[] = [];
const events: { start: string; end: string; title: string }[] = [];

calendars.forEach(({ vcalendar }) => {
const vevents = vcalendar.getAllSubcomponents("vevent");
Expand All @@ -159,7 +159,9 @@ export default class ICSFeedCalendarService implements Calendar {
// if (vevent?.getFirstPropertyValue("transp") === "TRANSPARENT") return;

const event = new ICAL.Event(vevent);
const title = vevent.getFirstPropertyValue("summary");
const dtstartProperty = vevent.getFirstProperty("dtstart");
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const tzidFromDtstart = dtstartProperty ? (dtstartProperty as any).jCal[1].tzid : undefined;

const dtstart: { [key: string]: string } | undefined = vevent?.getFirstPropertyValue("dtstart");
Expand Down Expand Up @@ -263,6 +265,7 @@ export default class ICSFeedCalendarService implements Calendar {
events.push({
start: currentStart.toISOString(),
end: dayjs(currentEvent.endDate.toJSDate()).toISOString(),
title: title as string,
});
}
}
Expand All @@ -283,6 +286,7 @@ export default class ICSFeedCalendarService implements Calendar {
return events.push({
start: finalStartISO,
end: finalEndISO,
title: title as string,
});
});
});
Expand Down
Loading