From d08d87f47ce7beb5e2d59678fa146ba9f8bd3da4 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Tue, 12 Nov 2024 23:23:59 +0300 Subject: [PATCH] test:get date based calendar test to run --- src/calendarUtil.js | 4 ++-- test/test_calendars/US_Holidays.ics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calendarUtil.js b/src/calendarUtil.js index 64209f0..e7c35c5 100644 --- a/src/calendarUtil.js +++ b/src/calendarUtil.js @@ -29,8 +29,8 @@ export async function fetchCalendarData(calendar) { // Create a top-level VCALENDAR component export function createCalendarComponent(name) { const calendarComponent = new ICAL.Component(['vcalendar', [], []]); - calendarComponent.updatePropertyWithValue('version', '2.0'); calendarComponent.updatePropertyWithValue('name', name); + calendarComponent.updatePropertyWithValue('version', '2.0'); return calendarComponent; } @@ -73,11 +73,11 @@ export function addEventsToCalendar(calendarComponent, results) { } else { console.warn('DTSTAMP not found in the original event.'); // Warn if DTSTAMP is missing } - newEvent.updatePropertyWithValue('summary', vevent.summary.trim()); // Set SUMMARY without leading spaces // Set the dtstart and dtend properties using ICAL.Time newEvent.updatePropertyWithValue('dtstart', startTime); newEvent.updatePropertyWithValue('dtend', endTime); + newEvent.updatePropertyWithValue('summary', vevent.summary.trim()); // Add the new event to the calendar component diff --git a/test/test_calendars/US_Holidays.ics b/test/test_calendars/US_Holidays.ics index d8ace67..842dd79 100644 --- a/test/test_calendars/US_Holidays.ics +++ b/test/test_calendars/US_Holidays.ics @@ -8,4 +8,4 @@ DTSTART;VALUE=DATE:20231225 DTEND;VALUE=DATE:20231226 SUMMARY:Christmas Day END:VEVENT -END:VCALENDAR +END:VCALENDAR \ No newline at end of file