Skip to content

Commit

Permalink
front: fix rounded hours
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Macron <[email protected]>
  • Loading branch information
Akctarus committed Feb 25, 2025
1 parent 3ebcea2 commit 4ece033
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ type TrainScheduleItemProps = {
};

const formatFullDate = (d: Date) => dayjs(d).format('D/MM/YYYY HH:mm:ss');
const formatDateHours = (d: Date) => dayjs(d).format('HH:mm');
const formatDateHours = (d: Date) =>
dayjs(d)
.add(d.getSeconds() >= 30 ? 1 : 0, 'minute')
.format('HH:mm');

const TrainScheduleItem = ({
isInSelection,
Expand Down
4 changes: 2 additions & 2 deletions front/tests/012-op-simulation-settings-tab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ test.describe('Simulation Settings Tab Verification', () => {
// Add the train schedule and verify output results
await operationalStudiesPage.addTrainSchedule();
await operationalStudiesPage.returnSimulationResult();
await opTimetablePage.getTrainArrivalTime('11:54');
await opTimetablePage.getTrainArrivalTime('11:55');
await opTimetablePage.clickOnScenarioCollapseButton();
await opOutputTablePage.verifyTimesStopsDataSheetVisibility();
await performOnSpecificOSAndBrowser(
Expand All @@ -334,7 +334,7 @@ test.describe('Simulation Settings Tab Verification', () => {
await operationalStudiesPage.clickOnSimulationSettingsTab();
await opSimulationSettingsPage.activateMarecoMargin();
await opTimetablePage.clickOnEditTrainSchedule();
await opTimetablePage.getTrainArrivalTime('11:54');
await opTimetablePage.getTrainArrivalTime('11:55');
await opTimetablePage.clickOnScenarioCollapseButton();
await opOutputTablePage.verifyTimesStopsDataSheetVisibility();
await performOnSpecificOSAndBrowser(
Expand Down

0 comments on commit 4ece033

Please sign in to comment.