From d9ec6220557bd68e21926884a44fb84da1ddc1a8 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 22 Aug 2026 19:57:14 +0200 Subject: [PATCH] Show event times in Berlin time `toLocaleString()` was given the German locale but no time zone, so it printed the time in whatever zone the browser of the visitor is set to. The events happen in Berlin, so this is only correct for visitors who are in Berlin. Somebody reading the start page from Sydney was told the Plenum of Tuesday 20:00 takes place on Wednesday at 04:00. Format in Europe/Berlin explicitly. Only the printing was wrong, picking and sorting the events works on absolute points in time and was not affected. Drop the two replacements around the formatted date while touching it. The first removes the comma after the weekday and the second puts it back, so they cancel each other out: "Samstag, 22.08., 17:00" -> "Samstag 22.08., 17:00" -> "Samstag, 22.08., 17:00" Fixes: c28f04c6e85c ("switch to ics files; make calendars work; fix some minor issues") Assisted-by: Claude:claude-opus-5 Signed-off-by: Hauke Mehrtens --- static/js/upcoming.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/upcoming.js b/static/js/upcoming.js index b172d83..c452467 100644 --- a/static/js/upcoming.js +++ b/static/js/upcoming.js @@ -109,14 +109,17 @@ document.addEventListener("DOMContentLoaded", () => { const colBegin = document.createElement("td"); const formattedStart = event.start.toLocaleString("de-DE", { + // The events take place in Berlin, so name their time in Berlin time + // instead of in the time zone the visitor happens to be in. + timeZone: "Europe/Berlin", weekday: "long", day: "2-digit", month: "2-digit", hour: "2-digit", minute: "2-digit", - }).replace(",", ""); + }); - colBegin.innerText = `${formattedStart.replace(" ", ", ")} Uhr`; + colBegin.innerText = `${formattedStart} Uhr`; row.appendChild(colBegin); const colName = document.createElement("td");