Merge branch '13-popup-informations-in-ical-viewer' into 'main'

fix:#13 colorized array type

See merge request htwk-software/htwkalender-pwa!8
This commit is contained in:
Elmar Kresse
2024-06-10 10:00:21 +00:00

View File

@ -41,7 +41,10 @@ export function parseICalData(
const jCalData = ICAL.parse(icalData); const jCalData = ICAL.parse(icalData);
const comp = new ICAL.Component(jCalData); const comp = new ICAL.Component(jCalData);
const vEvents = comp.getAllSubcomponents("vevent"); 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) => { return vEvents.map((vevent: CalendarComponent) => {
const event = new ICAL.Event(vevent); const event = new ICAL.Event(vevent);
@ -127,6 +130,7 @@ function colorizeEvents(vEvents: CalendarComponent[]): ColorDistinctionEvent[] {
}); });
} }
// Exported for testing
export const exportedForTesting = { export const exportedForTesting = {
extractedColorizedEvents, extractedColorizedEvents,
filterEventsDistinct, filterEventsDistinct,