Skip to content

Commit

Permalink
fixes to display 12 instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kurund committed Jan 30, 2022
1 parent 9ec7fbe commit 75d7e11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ export const hourList: any = Array.from(Array(24), (_, i) => {
timeOfDay = 'PM';
hour -= 12;
}

let hourLabel = hour.toString();
if (hour === 0) {
hourLabel = '12';
}

return {
id: i,
label: `${hour.toString()} ${timeOfDay}`,
label: `${hourLabel} ${timeOfDay}`,
};
});

Expand Down

0 comments on commit 75d7e11

Please sign in to comment.