From 387a4664c675e85def2fd02d8caf404d4a5414ca Mon Sep 17 00:00:00 2001 From: Elmar Kresse Date: Mon, 10 Jun 2024 12:00:05 +0200 Subject: [PATCH] fix:#13 colorized array type --- frontend/src/helpers/ical.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/helpers/ical.ts b/frontend/src/helpers/ical.ts index 05d7851..a4fb468 100644 --- a/frontend/src/helpers/ical.ts +++ b/frontend/src/helpers/ical.ts @@ -41,7 +41,10 @@ export function parseICalData( const jCalData = ICAL.parse(icalData); const comp = new ICAL.Component(jCalData); const vEvents = comp.getAllSubcomponents("vevent"); - const colorDistinctionEvents = extractedColorizedEvents(vEvents); + const events: CalendarComponent[] = vEvents.map((vevent: CalendarComponent) => { + return new ICAL.Event(vevent); + }); + const colorDistinctionEvents: ColorDistinctionEvent[] = extractedColorizedEvents(events); return vEvents.map((vevent: CalendarComponent) => { const event = new ICAL.Event(vevent); @@ -127,6 +130,7 @@ function colorizeEvents(vEvents: CalendarComponent[]): ColorDistinctionEvent[] { }); } +// Exported for testing export const exportedForTesting = { extractedColorizedEvents, filterEventsDistinct,