Skip to content

Commit 6423d25

Browse files
cbrnrdrammock
andauthored
Update doc/conf.py
Co-authored-by: Daniel McCloy <[email protected]>
1 parent f4f9780 commit 6423d25

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

doc/conf.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,7 @@
6868
function formatTimestamp() {
6969
document.querySelectorAll("time.localized").forEach(el => {
7070
const d = new Date(el.getAttribute("datetime"));
71-
const pad = n => String(Math.abs(n)).padStart(2, '0');
72-
const year = d.getFullYear();
73-
const month = pad(d.getMonth() + 1);
74-
const day = pad(d.getDate());
75-
const hour = pad(d.getHours());
76-
const minute = pad(d.getMinutes());
77-
const tzOffset = -d.getTimezoneOffset();
78-
const sign = tzOffset >= 0 ? "+" : "-";
79-
const absOffset = Math.abs(tzOffset);
80-
const tzHour = pad(Math.floor(absOffset / 60));
81-
const tzMin = pad(absOffset % 60);
82-
const tzStr = `${sign}${tzHour}:${tzMin}`;
83-
el.textContent = `${year}-${month}-${day} ${hour}:${minute} UTC${tzStr}`;
71+
el.textContent = d.toLocaleString("SE", { "timeZoneName": "short" });
8472
});
8573
}
8674
if (document.readyState !== "loading") {

0 commit comments

Comments
 (0)