Skip to content

Commit

Permalink
Fixed midnight hour shows 24:XX (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
valonm authored Mar 5, 2024
1 parent 75912e3 commit 5072a3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/activities/RosterView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function RosterTimeValue({ startTime, time }: { startTime: number; time: number
const dateDiff = Math.abs(differenceInCalendarDays(new Date(startTime), new Date(time)));

const dateString = new Date(time).toLocaleString('en-US', { month: '2-digit', day: '2-digit', year: '2-digit' });
const timeString = new Date(time).toLocaleString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' }).replace(':', '');
const timeString = new Date(time).toLocaleString('en-US', { hourCycle: 'h23', hour: '2-digit', minute: '2-digit' }).replace(':', '');
return (
<>
<Typography variant="h6">{timeString}</Typography>
Expand Down

0 comments on commit 5072a3c

Please sign in to comment.