From b6c0b5e55804845fd41ed4f8fd0e9f4bda66237c Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 19 Jan 2024 09:02:08 +0100 Subject: [PATCH] added: modify date time --- ics.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ics.js b/ics.js index a7e8cac..2aede74 100644 --- a/ics.js +++ b/ics.js @@ -57,7 +57,7 @@ function dt(s) + s.substr(9,2) + ":" + s.substr(11,2) + ":" + s.substr(13,2)); } -function displayevents(events, func, title) +function displayevents(events, func, title, created) { var group = {}; events @@ -70,7 +70,7 @@ function displayevents(events, func, title) var month = splitdate[2]; group[year] = group[year] || {}; group[year][month] = group[year][month] || []; - group[year][month].push(formatteddate + ": " + e.SUMMARY); + group[year][month].push(formatteddate + ": " + e.SUMMARY + (created ? ` (modifié le ${e.DTSTAMP.toLocaleString('fr-FR', { timeZone: 'Europe/Paris', dateStyle: "full" })})` : "")); }); console.log(title); for (var year in group) @@ -96,7 +96,7 @@ function main() var lastweek = new Date(); lastweek.setDate(lastweek.getDate() - settings.recentdays); - displayevents(o.VEVENTS, e => e.DTSTART >= (new Date) && e.DTSTAMP >= lastweek, "Changements récents"); + displayevents(o.VEVENTS, e => e.DTSTART >= (new Date) && e.DTSTAMP >= lastweek, "Changements récents", true); } fs.readFile('settings.json', 'utf8', (err, data) =>