fixed multiple caldav integration bugs (#1764)
This commit is contained in:
@@ -192,7 +192,7 @@ export default abstract class BaseCalendarService implements Calendar {
|
||||
const objects = (
|
||||
await Promise.all(
|
||||
selectedCalendars
|
||||
.filter((sc) => sc.integration === "caldav_calendar")
|
||||
.filter((sc) => ["caldav_calendar", "apple_calendar"].includes(sc.integration ?? ""))
|
||||
.map((sc) =>
|
||||
fetchCalendarObjects({
|
||||
calendar: {
|
||||
@@ -216,20 +216,10 @@ export default abstract class BaseCalendarService implements Calendar {
|
||||
const vcalendar = new ICAL.Component(jcalData);
|
||||
const vevent = vcalendar.getFirstSubcomponent("vevent");
|
||||
const event = new ICAL.Event(vevent);
|
||||
const calendarTimezone =
|
||||
vcalendar.getFirstSubcomponent("vtimezone")?.getFirstPropertyValue("tzid") || "";
|
||||
|
||||
const startDate = calendarTimezone
|
||||
? dayjs(event.startDate.toJSDate()).tz(calendarTimezone)
|
||||
: new Date(event.startDate.toUnixTime() * 1000);
|
||||
|
||||
const endDate = calendarTimezone
|
||||
? dayjs(event.endDate.toJSDate()).tz(calendarTimezone)
|
||||
: new Date(event.endDate.toUnixTime() * 1000);
|
||||
|
||||
return {
|
||||
start: startDate.toISOString(),
|
||||
end: endDate.toISOString(),
|
||||
start: event.startDate.toJSDate().toISOString(),
|
||||
end: event.endDate.toJSDate().toISOString(),
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user