refactor: rename lastweek

This commit is contained in:
quenousimporte 2024-01-23 09:42:52 +01:00
parent 6750673779
commit fe3d2700c7
1 changed files with 4 additions and 3 deletions

View File

@ -99,12 +99,13 @@ function showresult()
{ {
recent = 7; recent = 7;
} }
var html = "<h1>Evénements à venir</h1>"; var html = "<h1>Evénements à venir</h1>";
html += "<p>En gras: modifié les " + recent + " derniers jours</p>"; html += "<p>En gras: modifié les " + recent + " derniers jours</p>";
var o = ics2json(xhr.responseText); var o = ics2json(xhr.responseText);
var lastweek = new Date(); var lastmodified = new Date();
lastweek.setDate(lastweek.getDate() - recent); lastmodified.setDate(lastmodified.getDate() - recent);
var group = {}; var group = {};
o.VEVENTS o.VEVENTS
@ -129,7 +130,7 @@ function showresult()
} }
var line = `<li title="modifié le ${formatdate(e.DTSTAMP)}"> ${formatteddate}: ${e.SUMMARY}`; var line = `<li title="modifié le ${formatdate(e.DTSTAMP)}"> ${formatteddate}: ${e.SUMMARY}`;
if (e.DTSTAMP >= lastweek) if (e.DTSTAMP >= lastmodified)
{ {
line = `<b>${line}</b>`; line = `<b>${line}</b>`;
} }