Skip to content

Commit 8be84ad

Browse files
renable Time
1 parent e88165a commit 8be84ad

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

front/src/modules/simulationResult/components/SimulationResultsMap/TrainHoverPosition.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { AllowancesSetting, AllowancesSettings, Train } from 'reducers/osrdsimul
1515
import { boundedValue } from 'utils/numbers';
1616
import { getCurrentBearing } from 'utils/geometry';
1717
import OrderedLayer from 'common/Map/Layers/OrderedLayer';
18+
import { datetime2time } from 'utils/timeManipulation';
1819
import { TrainPosition } from './types';
1920

2021
function getFill(isSelectedTrain: boolean, ecoBlocks: boolean) {
@@ -26,16 +27,24 @@ function getFill(isSelectedTrain: boolean, ecoBlocks: boolean) {
2627

2728
function getSpeedTimeLabel(isSelectedTrain: boolean, ecoBlocks: boolean, point: TrainPosition) {
2829
if (isSelectedTrain) {
29-
console.log(point.speedTime);
3030
return (
3131
<>
3232
<span
33-
className={cx('small', 'train-speed-label', 'font-weight-bold', ecoBlocks ? 'text-secondary' : 'text-primary')}
33+
className={cx(
34+
'small',
35+
'train-speed-label',
36+
'font-weight-bold',
37+
ecoBlocks ? 'text-secondary' : 'text-primary'
38+
)}
3439
>
3540
{Math.round(point?.speedTime?.speed ?? 0)}
3641
km/h
3742
</span>
38-
{point.speedTime && <span className="ml-2 small">{`${point.speedTime.time}`}</span>}
43+
{point.speedTime?.time && (
44+
<span className="ml-2 small train-speed-label">{`${datetime2time(
45+
point.speedTime.time
46+
)}`}</span>
47+
)}
3948
</>
4049
);
4150
}

0 commit comments

Comments
 (0)