Fix workout reminder using the server's timezone instead of the user's
The reminder compared 'now' against a single TZ env var, so it only worked correctly for whoever's local time happened to match the server's. The browser now reports its own IANA timezone (auto- detected, no picker) and stores it with the reminder; the server computes each user's local time/date individually via Intl, and the client re-stamps it on every app load so it follows you when you travel.
This commit is contained in:
1 parent
7dea9ccfcc
commit
0ac531acb8
4 files changed
+36
-17
No files matched your search
@@ -31,5 +31,7 @@ export function weekKey(d) {
|
||||
return dt.getFullYear() + '-' + week
|
||||
}
|
||||
|
||||
export const localTZ = () => { try { return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC' } catch { return 'UTC' } }
|
||||
|
||||
export const uid = () => Date.now().toString(36) + Math.random().toString(36).slice(2, 7)
|
||||
export const ACCENTS = { lime: '#a3e635', sky: '#38bdf8', orange: '#fb923c', violet: '#a78bfa', pink: '#f472b6', red: '#f87171', teal: '#2dd4bf', gold: '#fbbf24' }
|
||||
Reference in new issue
Block a user