Files
babymonitor/plan.md
T
2026-05-27 15:18:29 +02:00

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

  1. Modify frontend/src/components/stats/WakeupPlot.tsx:
    • Remove the isLikelyOffset logic and manual offset calculations.
    • Use getLocalOffsetFromReference(day.wakeup_minutes, wakeup_ref) to calculate the correct local offset.
  2. Verify:
    • Ensure the component renders correctly with the new logic.

Files to change

  • frontend/src/components/stats/WakeupPlot.tsx