From 7dd1d77e21df9a01bb6b2b0c69fc28d2a4e00312 Mon Sep 17 00:00:00 2001 From: "fefe.clochette" Date: Tue, 9 Dec 2025 16:06:28 +0100 Subject: [PATCH] Auto-commit for deploy to production - 2025-12-09 16:06:28 --- assets/js/family-calendar.js | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/assets/js/family-calendar.js b/assets/js/family-calendar.js index 2057b84..52e2ceb 100644 --- a/assets/js/family-calendar.js +++ b/assets/js/family-calendar.js @@ -137,7 +137,6 @@ async function fetchSchoolHolidays(anneeScolaire, zoneLabel) { const baseUrl = "https://data.education.gouv.fr/api/explore/v2.1/catalog/datasets/fr-en-calendrier-scolaire/records"; - // Filtre: année scolaire + zone C, pas de filtre population (dataset est incohérent sur ce champ) const where = `annee_scolaire='${anneeScolaire}' AND zones LIKE '%${zoneLabel}%'`; const params = new URLSearchParams({ @@ -159,8 +158,8 @@ async function fetchSchoolHolidays(anneeScolaire, zoneLabel) { } /** - * Regroupe les records par période (start_date, end_date, description), - * remplit le tableau recap, et crée les événements VACANCES_SCOLAIRES. + * Regroupe les records par période, remplit le tableau recap, + * et crée les événements VACANCES_SCOLAIRES. */ function addSchoolHolidayEventsFromRecords(records, events) { const tbody = document.querySelector("#schoolHolidaysTable tbody"); @@ -236,29 +235,6 @@ function addSchoolHolidayEventsFromRecords(records, events) { } } -// 3) Créer les événements jour par jour (VACANCES_SCOLAIRES) -// end = date de reprise => on s'arrête la veille (current < end) -groups.forEach((g) => { - const start = new Date(g.startIso); - const end = new Date(g.endIso); - - let current = new Date(start); - while (current < end) { - const year = current.getFullYear(); - const month = String(current.getMonth() + 1).padStart(2, "0"); - const day = String(current.getDate()).padStart(2, "0"); - const isoDate = `${year}-${month}-${day}`; - - events.push({ - date: isoDate, - type: "VACANCES_SCOLAIRES", - duration: 1, - }); - - current.setDate(current.getDate() + 1); - } -}); - /** * Marque les jours et les semaines de vacances scolaires dans weeks. */