respect the timezone from the ical event (#2361)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/2377/head
parent
ffff59dd00
commit
2d6cb1eb73
|
@ -248,10 +248,12 @@ 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 timezoneComp = vcalendar.getFirstSubcomponent("vtimezone");
|
||||
const tzid: string = timezoneComp?.getFirstPropertyValue("tzid") ?? "UTC";
|
||||
|
||||
return {
|
||||
start: event.startDate.toJSDate().toISOString(),
|
||||
end: event.endDate.toJSDate().toISOString(),
|
||||
start: dayjs.tz(event.startDate.toJSDate(), tzid).toISOString(),
|
||||
end: dayjs.tz(event.endDate.toJSDate(), tzid).toISOString(),
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue