829 B
829 B
Plan: Fix Timezone issues in WakeupPlot
Problem
WakeupPlot.tsx uses an incorrect manual calculation for timezone offsets and a dubious isLikelyOffset heuristic. This causes incorrect time displays (e.g., subtracting the offset instead of adding it).
Goal
Align WakeupPlot.tsx with BedtimePlot.tsx by using the existing getLocalOffsetFromReference utility to correctly apply client-side timezone adjustments.
Steps
- Modify
frontend/src/components/stats/WakeupPlot.tsx:- Remove the
isLikelyOffsetlogic and manual offset calculations. - Use
getLocalOffsetFromReference(day.wakeup_minutes, wakeup_ref)to calculate the correct local offset.
- Remove the
- Verify:
- Ensure the component renders correctly with the new logic.
Files to change
frontend/src/components/stats/WakeupPlot.tsx