Skip to content

Commit 78c1d2b

Browse files
Synarclarani
authored andcommitted
front: handle stopfor input with unit in timesstops table
Signed-off-by: Alice Khoudli <alice.khoudli@polytechnique.org>
1 parent ec5dac5 commit 78c1d2b

File tree

1 file changed

+4
-0
lines changed
  • front/src/modules/timesStops/helpers

1 file changed

+4
-0
lines changed

front/src/modules/timesStops/helpers/utils.ts

+4
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ export function updateRowTimesAndMargin(
193193
newRowData.theoreticalMargin = '0%';
194194
}
195195
}
196+
// Remove second unit in stopFor if inputted by mistake
197+
if (newRowData.stopFor && /^[0-9]+ *s$/i.test(newRowData.stopFor)) {
198+
newRowData.stopFor = newRowData.stopFor.replace(/ *s$/i, '');
199+
}
196200
return newRowData;
197201
}
198202

0 commit comments

Comments
 (0)