diff --git a/frontend/src/pages.jsx b/frontend/src/pages.jsx index 989132a..1c44431 100644 --- a/frontend/src/pages.jsx +++ b/frontend/src/pages.jsx @@ -451,9 +451,9 @@ export function PersonenPage() {
- - - {wizardAan && } + + + {wizardAan && }
{importView ? : (<> @@ -1465,8 +1465,8 @@ export function GebruikersPage() { {gegenereerd &&
Tijdelijk wachtwoord: {gegenereerd} — geef dit door aan de gebruiker; laat het daarna wijzigen.
}
- - + +
{view === "import" ? : (<>
@@ -1550,6 +1550,21 @@ function Conflicten({ schooljaar }) { function pad2(n) { return String(n).padStart(2, "0"); } function fmtISO(d) { return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`; } function fmtDM(d) { return `${pad2(d.getDate())}-${pad2(d.getMonth() + 1)}`; } +const MAANDEN = ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"]; +function isoWeeknr(d) { + const t = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())); + const dag = (t.getUTCDay() + 6) % 7; + t.setUTCDate(t.getUTCDate() - dag + 3); + const eersteDo = new Date(Date.UTC(t.getUTCFullYear(), 0, 4)); + return 1 + Math.round(((t - eersteDo) / 86400000 - 3 + ((eersteDo.getUTCDay() + 6) % 7)) / 7); +} +function weekTitel(maandag) { + const vrij = plusDagen(maandag, 4); + const reeks = maandag.getMonth() === vrij.getMonth() + ? `${maandag.getDate()}\u2013${vrij.getDate()} ${MAANDEN[vrij.getMonth()]}` + : `${maandag.getDate()} ${MAANDEN[maandag.getMonth()]} \u2013 ${vrij.getDate()} ${MAANDEN[vrij.getMonth()]}`; + return `Week ${isoWeeknr(maandag)} \u00b7 ${reeks}`; +} function maandagVan(d) { const x = new Date(d); x.setHours(0, 0, 0, 0); const wd = (x.getDay() + 6) % 7; x.setDate(x.getDate() - wd); return x; } function plusDagen(d, n) { const x = new Date(d); x.setDate(x.getDate() + n); return x; } @@ -2383,10 +2398,10 @@ export function RoosterScherm({ mode }) { {schooljaar && (
- - - - week van {fmtDM(maandag)} + + {weekTitel(maandag)} + +
)} {edit && schooljaar && tab === "week" && } @@ -2406,7 +2421,7 @@ export function RoosterScherm({ mode }) { - {scopeType !== "alles" && ( + {(scopeType === "leerling" || scopeType === "personeel") && (