Invert overtime (#1715)

* refactor: invert offset calculation

* chore: update tests

* chore: flip offset in UI

* fix seconds display on group target duration

* update comment

* fix rebase
This commit is contained in:
Alex Christoffer Rasmussen
2025-08-10 18:22:02 +02:00
committed by Carlos Valente
parent 4665f9c2f7
commit e0149c1cbf
11 changed files with 127 additions and 172 deletions
@@ -43,14 +43,14 @@ export function getExpectedStart(
const scheduledStartTime = normalisedTimeStart + relativeStartOffset;
const offsetStartTime = scheduledStartTime - offset;
const offsetStartTime = scheduledStartTime + offset;
if (isLinkedToLoaded) {
//if we are directly linked back to the loaded event we just follow the offset
return offsetStartTime;
}
const gapsCanCompensateForOffset = totalGap + offset >= 0;
const gapsCanCompensateForOffset = totalGap > offset;
if (gapsCanCompensateForOffset) {
// if we are ahead of schedule or the gap can compensate for the amount we are behind then expect to start at the scheduled time
return scheduledStartTime;