From 1bb8eda0ec17b34695bb95a50e3078345b7139d0 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Tue, 22 Oct 2024 19:22:57 +0300 Subject: [PATCH] support time based events --- server.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index f8987f3..72d0f24 100644 --- a/server.js +++ b/server.js @@ -87,8 +87,8 @@ METHOD:PUBLISH `; mergedCal.forEach((event) => { icalString += `BEGIN:VEVENT -DTSTART;VALUE=DATE:${event.start.toISOString().split('T')[0].replace(/-/g, '')} -DTEND;VALUE=DATE:${ event.end.toISOString().split('T')[0].replace(/-/g, '')} +DTSTART;VALUE=DATETIME:${event.start.toISOString().replace(/-|:|\.\d{3}/g, '')} +DTEND;VALUE=DATETIME:${event.end.toISOString().replace(/-|:|\.\d{3}/g, '')} SUMMARY:${event.summary} END:VEVENT `; @@ -208,8 +208,8 @@ METHOD:PUBLISH `; mergedCal.forEach((event) => { icalString += `BEGIN:VEVENT -DTSTART;VALUE=DATE:${event.start.toISOString().split('T')[0].replace(/-/g, '')} -DTEND;VALUE=DATE:${event.end.toISOString().split('T')[0].replace(/-/g, '')} +DTSTART;VALUE=DATETIME:${event.start.toISOString().replace(/-|:|\.\d{3}/g, '')} +DTEND;VALUE=DATETIME:${event.end.toISOString().replace(/-|:|\.\d{3}/g, '')} SUMMARY:${event.summary} END:VEVENT `;