Auto-commit for deploy to production - 2025-12-09 13:34:38
This commit is contained in:
@@ -212,20 +212,18 @@ function addSchoolHolidayEventsFromRecords(records, events) {
|
|||||||
groups.forEach((g) => {
|
groups.forEach((g) => {
|
||||||
const start = new Date(g.startIso);
|
const start = new Date(g.startIso);
|
||||||
const end = new Date(g.endIso);
|
const end = new Date(g.endIso);
|
||||||
|
|
||||||
let current = new Date(start);
|
let current = new Date(start);
|
||||||
while (current <= end) {
|
// end = date de reprise -> on s'arrête la veille
|
||||||
|
while (current < end) {
|
||||||
const year = current.getFullYear();
|
const year = current.getFullYear();
|
||||||
const month = String(current.getMonth() + 1).padStart(2, "0");
|
const month = String(current.getMonth() + 1).padStart(2, "0");
|
||||||
const day = String(current.getDate()).padStart(2, "0");
|
const day = String(current.getDate()).padStart(2, "0");
|
||||||
const isoDate = `${year}-${month}-${day}`;
|
const isoDate = `${year}-${month}-${day}`;
|
||||||
|
|
||||||
events.push({
|
events.push({
|
||||||
date: isoDate,
|
date: isoDate,
|
||||||
type: "VACANCES_SCOLAIRES",
|
type: "VACANCES_SCOLAIRES",
|
||||||
duration: 1,
|
duration: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
current.setDate(current.getDate() + 1);
|
current.setDate(current.getDate() + 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user