// Shared by the local kiosk pages: device name, clock/date, kiosk link and admin address. const params = new URLSearchParams(location.search); const fmtTime = new Intl.DateTimeFormat("nl-NL", { hour: "2-digit", minute: "2-digit" }); const fmtDate = new Intl.DateTimeFormat("nl-NL", { weekday: "long", day: "numeric", month: "long" }); function setText(id, text) { const el = document.getElementById(id); if (el) el.textContent = text; } setText("name", params.get("name") || "Daynivo Kiosk"); // The link arrives with its token already masked (…abcd). const link = (params.get("url") || "").replace(/^https:\/\//, ""); if (link) setText("link-url", link); else document.getElementById("link")?.setAttribute("hidden", ""); setText("admin", params.get("admin") ? "Beheer: " + params.get("admin") : ""); function tickClock() { const now = new Date(); setText("clock", fmtTime.format(now)); const date = fmtDate.format(now); setText("date", date.charAt(0).toUpperCase() + date.slice(1)); } tickClock(); setInterval(tickClock, 1000);