const formatHour = (hour: HoursEnum): string => {
return hour.toString().padStart(2, '0');
};
const is12HourFormat = (hour: HoursEnum): string => {
if (hour === 0) return '12 AM';
if (hour === 12) return '12 PM';
if (hour < 12) return `${hour} AM`;
return `${hour - 12} PM`;
};
type Midnight = 0 satisfies HoursEnum;
type Noon = 12 satisfies HoursEnum;
type ElevenPM = 23 satisfies HoursEnum;
Represents the hours in a day using 24-hour format. A union of integer literals from
0(midnight) to23(11 PM).Uses the international standard 24-hour time format where:
0represents midnight (00:00)12represents noon (12:00)23represents 11 PM (23:00)