diff --git a/src/components/EventCard.astro b/src/components/EventCard.astro index 4256734..098436e 100644 --- a/src/components/EventCard.astro +++ b/src/components/EventCard.astro @@ -25,7 +25,7 @@ const accentColor = categoryColors[type] || categoryColors["default"];
- ÉVÉNEMENT IRL + {type.toUpperCase()} {status}
@@ -42,7 +42,13 @@ const accentColor = categoryColors[type] || categoryColors["default"];

{summary}

- Membres impliqués : + + { + type === "Festival" + ? "Artistes invités :" + : "Membres impliqués :" + } +
{participants.map((p) => {p})}
diff --git a/src/pages/index.astro b/src/pages/index.astro index aaa0f6c..38d8f74 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -35,31 +35,37 @@ const getStreak = (name, entries) => { .reverse(); let streak = 0; let today = new Date(); + // Utiliser Date.UTC pour aligner la date locale avec le format ISO UTC des collections let checkDate = new Date( - today.getFullYear(), - today.getMonth(), - today.getDate(), + Date.UTC(today.getFullYear(), today.getMonth(), today.getDate()), ); + let todaySkipped = false; for (let i = 0; i < 31; i++) { const dateStr = checkDate.toISOString().split("T")[0]; if (uniqueDates.includes(dateStr)) { streak++; - checkDate.setDate(checkDate.getDate() - 1); + checkDate.setUTCDate(checkDate.getUTCDate() - 1); } else { if (i === 0) { - checkDate.setDate(checkDate.getDate() - 1); + checkDate.setUTCDate(checkDate.getUTCDate() - 1); const yesterdayStr = checkDate.toISOString().split("T")[0]; - if (uniqueDates.includes(yesterdayStr)) continue; + if (uniqueDates.includes(yesterdayStr)) { + todaySkipped = true; + continue; + } } break; } } // Malus HYG [cite: 103, 106] + const shiftDays = todaySkipped ? 1 : 0; const last7Days = Array.from({ length: 7 }, (_, j) => { - let d = new Date(); - d.setDate(d.getDate() - j); + let d = new Date( + Date.UTC(today.getFullYear(), today.getMonth(), today.getDate()), + ); + d.setUTCDate(d.getUTCDate() - (j + shiftDays)); return d.toISOString().split("T")[0]; });