Skip to content

Commit

Permalink
front: handle stopfor input with unit in timesstops table
Browse files Browse the repository at this point in the history
Signed-off-by: Alice Khoudli <[email protected]>
  • Loading branch information
Synar authored and clarani committed Nov 28, 2024
1 parent ec5dac5 commit 78c1d2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions front/src/modules/timesStops/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ export function updateRowTimesAndMargin(
newRowData.theoreticalMargin = '0%';
}
}
// Remove second unit in stopFor if inputted by mistake
if (newRowData.stopFor && /^[0-9]+ *s$/i.test(newRowData.stopFor)) {
newRowData.stopFor = newRowData.stopFor.replace(/ *s$/i, '');
}
return newRowData;
}

Expand Down

0 comments on commit 78c1d2b

Please sign in to comment.