mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-14 01:46:09 -07:00
fix: respect client timezone for requests (#119)
* maybe fixed for total listen activity * maybe actually fixed now * fix unset location panics
This commit is contained in:
parent
2925425750
commit
f48dd6c039
13 changed files with 368 additions and 343 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