From 19e76596ae8f5bef4e1d2d1202fa04eadfda206f Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Wed, 23 Jul 2025 09:16:42 +0200 Subject: [PATCH 1/8] Use 24h time for website timestamp --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 57a78df1e88..57cb45f558f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -64,7 +64,7 @@ # (Sphinx looks at variable changes and rewrites all files if some change) copyright = ( # noqa: A001 f'2012–{td.year}, MNE Developers. Last updated \n' # noqa: E501 - '' # noqa: E501 + '' # noqa: E501 ) if os.getenv("MNE_FULL_DATE", "false").lower() != "true": copyright = f"2012–{td.year}, MNE Developers. Last updated locally." # noqa: A001 From 5ff6d97e579bc3e32bf3f41d0ceb59896bd16261 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Wed, 23 Jul 2025 09:21:51 +0200 Subject: [PATCH 2/8] Format --- doc/conf.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 57cb45f558f..fcb366b5253 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -64,7 +64,18 @@ # (Sphinx looks at variable changes and rewrites all files if some change) copyright = ( # noqa: A001 f'2012–{td.year}, MNE Developers. Last updated \n' # noqa: E501 - '' # noqa: E501 + """""" ) if os.getenv("MNE_FULL_DATE", "false").lower() != "true": copyright = f"2012–{td.year}, MNE Developers. Last updated locally." # noqa: A001 From ec82c4e5599a4bc43d2b117c2df7757f54348d0b Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Wed, 23 Jul 2025 09:32:00 +0200 Subject: [PATCH 3/8] Use ISO 8601 --- doc/conf.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index fcb366b5253..f65f804baf8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -68,11 +68,18 @@ $(function () { $("time.localized").each(function () { var el = $(this); - el.text(new Date(el.attr("datetime")).toLocaleString([], { - dateStyle: "medium", - timeStyle: "long", + var d = new Date(el.attr("datetime")); + var date = d.toLocaleDateString("sv-SE", { + year: "numeric", + month: "2-digit", + day: "2-digit" + }); + var time = d.toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", hourCycle: "h23" - })); + }); + el.text(`${date} ${time}`); }); }); """ @@ -932,8 +939,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): klass="only-dark", ), dict(img="google.svg", size="2.25", title="Google"), - dict(img="amazon.svg", size="2.5", title="Amazon"), - dict(img="czi.svg", size="2.5", title="Chan Zuckerberg Initiative"), + dict(img="amazon.svg", size="2.5", title="Chan Zuckerberg Initiative"), ], "institutions": [ dict( From 00b21734d951e6cfa05a5bad220e3d213fe4bcbf Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Wed, 23 Jul 2025 09:50:45 +0200 Subject: [PATCH 4/8] Include GMT offset --- doc/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index f65f804baf8..69c36e71cf5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -77,7 +77,8 @@ var time = d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", - hourCycle: "h23" + hourCycle: "h23", + timeZoneName: "shortOffset" }); el.text(`${date} ${time}`); }); From 68a8d0e52ba57392ce78a4c5be14bc365d1ab5dd Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Wed, 23 Jul 2025 10:16:25 +0200 Subject: [PATCH 5/8] Revert unrelated change --- doc/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 69c36e71cf5..b205a66692a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -940,7 +940,8 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): klass="only-dark", ), dict(img="google.svg", size="2.25", title="Google"), - dict(img="amazon.svg", size="2.5", title="Chan Zuckerberg Initiative"), + dict(img="amazon.svg", size="2.5", title="Amazon"), + dict(img="czi.svg", size="2.5", title="Chan Zuckerberg Initiative"), ], "institutions": [ dict( From a0429508377854f38a0dc81ab5ae2a7b4ba2c8e1 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Wed, 23 Jul 2025 15:18:39 +0200 Subject: [PATCH 6/8] Remove jQuery --- doc/conf.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index b205a66692a..3d3d12daf16 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -65,24 +65,28 @@ copyright = ( # noqa: A001 f'2012–{td.year}, MNE Developers. Last updated \n' # noqa: E501 """""" ) if os.getenv("MNE_FULL_DATE", "false").lower() != "true": From a8f7e3e27d54ff8286980453bac1e71d9e850cdd Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Thu, 24 Jul 2025 13:47:12 +0200 Subject: [PATCH 7/8] Simplify --- doc/conf.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 3d3d12daf16..b4ac63a5ec1 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -68,18 +68,16 @@ function formatTimestamp() { document.querySelectorAll("time.localized").forEach(el => { const d = new Date(el.getAttribute("datetime")); - const date = d.toLocaleDateString("sv-SE", { + const options = { year: "numeric", month: "2-digit", - day: "2-digit" - }); - const time = d.toLocaleTimeString([], { + day: "2-digit", hour: "2-digit", minute: "2-digit", hourCycle: "h23", timeZoneName: "shortOffset" - }); - el.textContent = `${date} ${time}`; + }; + el.textContent = d.toLocaleString("sv-SE", options); }); } if (document.readyState !== "loading") { From 72be2bf5a6808d946968e4f409c2bb911edce714 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Thu, 14 Aug 2025 20:23:16 +0200 Subject: [PATCH 8/8] Try explicit locale --- doc/conf.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 7811b6dae36..9fdde31788d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -68,16 +68,8 @@ function formatTimestamp() { document.querySelectorAll("time.localized").forEach(el => { const d = new Date(el.getAttribute("datetime")); - const options = { - year: "numeric", - month: "2-digit", - day: "2-digit", - hour: "2-digit", - minute: "2-digit", - hourCycle: "h23", - timeZoneName: "shortOffset" - }; - el.textContent = d.toLocaleString("sv-SE", options); + const locale = Intl.DateTimeFormat().resolvedOptions().locale; + el.textContent = d.toLocaleString(locale); }); } if (document.readyState !== "loading") {