userpage: respect 12h/24h choice

This commit is contained in:
Harvey Tindall
2023-06-24 12:32:28 +01:00
parent 753f5fc517
commit fc7ae0ec4e
2 changed files with 14 additions and 4 deletions
+4 -3
View File
@@ -47,11 +47,12 @@ export class lang implements Lang {
}
}
export var TimeFmtChange = new CustomEvent("timefmt-change");
export const loadLangSelector = (page: string) => {
if (page == "admin") {
const ev = new CustomEvent("timefmt-change");
if (page == "admin" || "user") {
const setTimefmt = (fmt: string) => {
document.dispatchEvent(ev);
document.dispatchEvent(TimeFmtChange);
localStorage.setItem("timefmt", fmt);
};
const t12 = document.getElementById("lang-12h") as HTMLInputElement;