From 5e3e8eab5bb8ca246263e9180aaaf381dd41bdca Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Tue, 19 Nov 2024 15:59:23 +0300 Subject: [PATCH] feat(calendar): add METHOD property to calendar component if provided --- src/calendarUtil.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/calendarUtil.js b/src/calendarUtil.js index 4176065..13e2e97 100644 --- a/src/calendarUtil.js +++ b/src/calendarUtil.js @@ -43,6 +43,16 @@ export function addEventsToCalendar(calendarComponent, results, overrideFlag = f const parsed = ICAL.parse(result.data); const component = new ICAL.Component(parsed); + // Extract METHOD from the parsed data (if available) + const method = component.getFirstPropertyValue('method'); + if (method) { + console.log(`Extracted METHOD: ${method}`); + // Only add the METHOD property once + if (!calendarComponent.getFirstPropertyValue('method')) { + calendarComponent.updatePropertyWithValue('method', method.toUpperCase()); + } + } + // Extract and add VTIMEZONE components const timezones = component.getAllSubcomponents('vtimezone'); timezones.forEach((timezone) => {