Skip to content

Commit 7fa364d

Browse files
committed
front: fix rounded hours
Signed-off-by: Theo Macron <theo.macron0315@gmail.com>
1 parent b77308a commit 7fa364d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

front/src/modules/trainschedule/components/Timetable/TimetableTrainCard.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ type TimetableTrainCardProps = {
4747
};
4848

4949
const formatFullDate = (d: Date) => dayjs(d).format('D/MM/YYYY HH:mm:ss');
50-
const formatDateHours = (d: Date) => dayjs(d).format('HH:mm');
50+
const formatDateHours = (d: Date) =>
51+
dayjs(d)
52+
.add(d.getSeconds() >= 30 ? 1 : 0, 'minute')
53+
.format('HH:mm');
5154

5255
const TimetableTrainCard = ({
5356
isInSelection,

0 commit comments

Comments
 (0)