mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 15:02:04 +00:00
Date a workout by the user's timezone on the detail endpoint
The detail payload carried the session's start timestamp but nothing that said which local day it belongs to. Anything that wants the day around a workout had to slice the ISO string, which is the browser's day, not the person's: a 20:00 UTC session reads as the 15th in London and the 16th in Auckland. Resolve the day server-side from the user's timezone and ship it as dayKey. Additive, so a native client that does not read it is untouched.
This commit is contained in:
1 parent
a4cffbbea5
commit
0094445f07
5 files changed
+70
-1
No files matched your search
@@ -290,6 +290,14 @@ export type WorkoutActivityInsight = {
|
||||
} | null;
|
||||
|
||||
export interface WorkoutDetailPayload extends WorkoutListEntry {
|
||||
/**
|
||||
* The session's local calendar day, `YYYY-MM-DD`. Computed server-side
|
||||
* from `startedAt` in the user's timezone — never re-derived here, so a
|
||||
* browser in a different zone can't move the workout to another day. It
|
||||
* addresses the day-scoped reads the detail page renders around the
|
||||
* session.
|
||||
*/
|
||||
dayKey: string;
|
||||
minHr: number | null;
|
||||
stepCount: number | null;
|
||||
elevationM: number | null;
|
||||
|
||||
Reference in new issue
Block a user