From fe3d2700c7ba72bdc34575fd0f1571990ad93a7c Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 23 Jan 2024 09:42:52 +0100 Subject: [PATCH] refactor: rename lastweek --- ics.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ics.php b/ics.php index c62b8bd..e798f10 100644 --- a/ics.php +++ b/ics.php @@ -99,12 +99,13 @@ function showresult() { recent = 7; } + var html = "

Evénements à venir

"; html += "

En gras: modifié les " + recent + " derniers jours

"; var o = ics2json(xhr.responseText); - var lastweek = new Date(); - lastweek.setDate(lastweek.getDate() - recent); + var lastmodified = new Date(); + lastmodified.setDate(lastmodified.getDate() - recent); var group = {}; o.VEVENTS @@ -129,7 +130,7 @@ function showresult() } var line = `
  • ${formatteddate}: ${e.SUMMARY}`; - if (e.DTSTAMP >= lastweek) + if (e.DTSTAMP >= lastmodified) { line = `${line}`; }