mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 12:01:52 -07:00
maybe actually fixed now
This commit is contained in:
parent
913c6c00e5
commit
738ac871e6
12 changed files with 293 additions and 298 deletions
10
client/app/tz.ts
Normal file
10
client/app/tz.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
export function initTimezoneCookie() {
|
||||
if (typeof window === "undefined") return;
|
||||
|
||||
if (document.cookie.includes("tz=")) return;
|
||||
|
||||
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
if (!tz) return;
|
||||
|
||||
document.cookie = `tz=${tz}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue