mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-07 21:48:18 -08:00
* maybe fixed for total listen activity * maybe actually fixed now * fix unset location panics
10 lines
290 B
TypeScript
10 lines
290 B
TypeScript
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`;
|
|
}
|