mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 02:43:50 +00:00
fix: issue where a countToEnd would lead to incorrect expected times (#2149)
* fix: issue where a count-to-end would lead to incorrect expected times * fix: include add time in overtime when countToEnd * fix: ui and server use same calculation for expected end
This commit is contained in:
committed by
GitHub
parent
a8c611911d
commit
2a890cf2b3
@@ -5,6 +5,7 @@ import {
|
||||
MILLIS_PER_SECOND,
|
||||
dayInMs,
|
||||
formatFromMillis,
|
||||
getExpectedEnd,
|
||||
getExpectedStart,
|
||||
} from 'ontime-utils';
|
||||
|
||||
@@ -186,15 +187,13 @@ export function getExpectedTimesFromExtendedEvent(
|
||||
...state,
|
||||
},
|
||||
);
|
||||
|
||||
const expectedEnd = getExpectedEnd(event, expectedStart, state.currentDay);
|
||||
const plannedEnd = event.timeStart + event.duration + event.delay;
|
||||
|
||||
return {
|
||||
expectedStart,
|
||||
timeToStart: expectedStart - state.clock,
|
||||
expectedEnd: event.countToEnd
|
||||
? Math.max(expectedStart + event.duration, plannedEnd)
|
||||
: expectedStart + event.duration,
|
||||
expectedEnd,
|
||||
plannedEnd,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user