diff --git a/backend/src/routes/workforce.js b/backend/src/routes/workforce.js index d43d97f..8404e29 100644 --- a/backend/src/routes/workforce.js +++ b/backend/src/routes/workforce.js @@ -68,11 +68,11 @@ export async function workforceRoutes(app) { // Build a row for every date in the window (empty staff = no one scheduled) const dailyRows = [] - const cur = new Date(fromDate) - while (cur <= toDate) { - const d = fmtDate(cur) + const day = new Date(fromDate) + while (day <= toDate) { + const d = fmtDate(day) dailyRows.push({ date: d, staff: byDate[d] || [] }) - cur.setDate(cur.getDate() + 1) + day.setDate(day.getDate() + 1) } await upsertWorkforceShifts(dailyRows)