Skip to content

Commit 3d7b584

Browse files
committed
front: stdcm - new query should clear the hour field
Related to #9533 TimePicker component should not have a `value` properety, it only needs `hours`, `minutes` & `seconds`. See OpenRailAssociation/osrd-ui#807 for more informations Signed-off-by: Benoit Simard <contact@bsimard.com>
1 parent 2e83f60 commit 3d7b584

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

front/src/applications/stdcm/components/StdcmForm/StdcmOpSchedule.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useOsrdConfActions, useOsrdConfSelectors } from 'common/osrdContext';
88
import type { StdcmConfSliceActions } from 'reducers/osrdconf/stdcmConf';
99
import type { StdcmPathStep } from 'reducers/osrdconf/types';
1010
import { useAppDispatch } from 'store';
11-
import { dateToHHMMSS, formatDateString } from 'utils/date';
11+
import { formatDateString } from 'utils/date';
1212
import { createStringSelectOptions } from 'utils/uiCoreHelpers';
1313

1414
import type { ArrivalTimeTypes, ScheduleConstraint } from '../../types';
@@ -28,16 +28,14 @@ const StdcmOpSchedule = ({ disabled, pathStep, opId, isOrigin = false }: StdcmOp
2828
const { getSearchDatetimeWindow } = useOsrdConfSelectors();
2929
const searchDatetimeWindow = useSelector(getSearchDatetimeWindow);
3030

31-
const { arrivalTime, arrivalTimeHours, arrivalTimeMinutes } = useMemo(() => {
31+
const { arrivalTimeHours, arrivalTimeMinutes } = useMemo(() => {
3232
if (!pathStep.arrival) {
3333
return {
34-
arrivalTime: undefined,
3534
arrivalTimeHours: undefined,
3635
arrivalTimeMinutes: undefined,
3736
};
3837
}
3938
return {
40-
arrivalTime: dateToHHMMSS(pathStep.arrival, { withoutSeconds: true }),
4139
arrivalTimeHours: pathStep.arrival.getHours(),
4240
arrivalTimeMinutes: pathStep.arrival.getMinutes(),
4341
};
@@ -143,7 +141,6 @@ const StdcmOpSchedule = ({ disabled, pathStep, opId, isOrigin = false }: StdcmOp
143141
});
144142
}}
145143
disabled={disabled}
146-
value={arrivalTime}
147144
readOnly={false}
148145
/>
149146
<div className="mr-n2 pr-1">

0 commit comments

Comments
 (0)