Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4ece033

Browse files
committedFeb 25, 2025·
front: fix rounded hours
Signed-off-by: Theo Macron <theo.macron0315@gmail.com>
1 parent 3ebcea2 commit 4ece033

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
 

‎front/src/modules/trainschedule/components/Timetable/TrainScheduleItem.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ type TrainScheduleItemProps = {
4444
};
4545

4646
const formatFullDate = (d: Date) => dayjs(d).format('D/MM/YYYY HH:mm:ss');
47-
const formatDateHours = (d: Date) => dayjs(d).format('HH:mm');
47+
const formatDateHours = (d: Date) =>
48+
dayjs(d)
49+
.add(d.getSeconds() >= 30 ? 1 : 0, 'minute')
50+
.format('HH:mm');
4851

4952
const TrainScheduleItem = ({
5053
isInSelection,

‎front/tests/012-op-simulation-settings-tab.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ test.describe('Simulation Settings Tab Verification', () => {
311311
// Add the train schedule and verify output results
312312
await operationalStudiesPage.addTrainSchedule();
313313
await operationalStudiesPage.returnSimulationResult();
314-
await opTimetablePage.getTrainArrivalTime('11:54');
314+
await opTimetablePage.getTrainArrivalTime('11:55');
315315
await opTimetablePage.clickOnScenarioCollapseButton();
316316
await opOutputTablePage.verifyTimesStopsDataSheetVisibility();
317317
await performOnSpecificOSAndBrowser(
@@ -334,7 +334,7 @@ test.describe('Simulation Settings Tab Verification', () => {
334334
await operationalStudiesPage.clickOnSimulationSettingsTab();
335335
await opSimulationSettingsPage.activateMarecoMargin();
336336
await opTimetablePage.clickOnEditTrainSchedule();
337-
await opTimetablePage.getTrainArrivalTime('11:54');
337+
await opTimetablePage.getTrainArrivalTime('11:55');
338338
await opTimetablePage.clickOnScenarioCollapseButton();
339339
await opOutputTablePage.verifyTimesStopsDataSheetVisibility();
340340
await performOnSpecificOSAndBrowser(

0 commit comments

Comments
 (0)
Please sign in to comment.