Skip to content

Commit 69dfcb0

Browse files
committed
Added missing Math.max call
1 parent eaad04c commit 69dfcb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/component/itinerary/navigator/NaviInstructions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default function NaviInstructions(
5151
const remainingDuration = Math.max(
5252
Math.ceil((legTime(start) - time) / 60000),
5353
0,
54-
); // ms to minutes
54+
); // ms to minutes, >= 0
5555
const rt = nextLeg.realtimeState === 'UPDATED';
5656
const values = {
5757
duration: withRealTime(rt, remainingDuration),
@@ -104,7 +104,7 @@ export default function NaviInstructions(
104104
: intl.formatMessage({ id: 'navileg-from-stop' });
105105
const localizedMode = getLocalizedMode(leg.mode, intl);
106106

107-
const remainingDuration = Math.ceil((t - time) / 60000); // ms to minutes
107+
const remainingDuration = Math.max(Math.ceil((t - time) / 60000), 0); // ms to minutes, >= 0
108108
const values = {
109109
stopOrStation,
110110
stop: leg.to.stop.name,

0 commit comments

Comments
 (0)