Files
ontime/apps
Claude c96151fe2f fix(timer): make all pause maths wrap-aware
pausedAt is now an instant, but getExpectedFinish, getCurrent and
getRuntimeOffset were still deriving the pause duration from the time of
day clock (clock - pausedAt), which mixes units and produces a garbage
result on every paused timer.

- derive the ongoing pause from the instant in a single helper, so the
  duration is correct also when the pause spans midnight
- getCurrent no longer special cases a paused timer: it discounts the
  ongoing pause from the elapsed time, which keeps the midnight
  correction that the paused branch was missing
- reuse timeCore.elapsedTime instead of a local copy of the same logic
- type getCurrent as a Duration and getElapsed as Maybe<Duration> to
  document that these are durations, never points in time
- keep _now in parity with the clock in roll()
- type the restore point pausedAt as an instant and reject restore points
  which still carry a time of day, resuming those would corrupt the timer

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WA6Z38L7VY2oD6B4vG8hn
2026-08-28 09:53:18 +00:00
..
2026-08-09 10:44:13 +02:00
2026-08-09 10:44:13 +02:00
2026-08-09 10:44:13 +02:00
2026-03-08 16:22:12 +01:00