mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 08:23:55 +00:00
05c000118b
getExpectedEnd compared the offset-laden expectedStart against a raw `timeStart + duration + delay` planned end. That planned end omits the `(dayOffset - currentDay) * dayInMs` day shift that expectedStart already carries, so for a count-to-end event on a later day the Math.max guard returned the day-shifted start instead of the day-shifted end (wrong by one duration). Compute the scheduled end in the same day-normalised space before the guard. The guard itself (finish on schedule unless the start is compromised) is unchanged. Add unit tests for the multi-day case, the compromised-start guard, and relative mode. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACGuFWt5aN7Fv3AkYXgxLm