| 1 |
/** |
| 2 |
* Time format constants used across the application |
| 3 |
* Centralized time-related constants for validation, formatting, and calculations |
| 4 |
*/ |
| 5 |
export const TIME_CONSTANTS = { |
| 6 |
/** Minimum hour in 24-hour format (0 = midnight) */ |
| 7 |
MIN_HOUR_24: 0 as number, |
| 8 |
|
| 9 |
/** Maximum hour in 24-hour format (23 = 11 PM) */ |
| 10 |
MAX_HOUR_24: 23 as number, |
| 11 |
|
| 12 |
/** Minimum hour in 12-hour format (1 AM) */ |
| 13 |
MIN_HOUR_12: 1 as number, |
| 14 |
|
| 15 |
/** Maximum hour in 12-hour format (12 PM/AM) */ |
| 16 |
MAX_HOUR_12: 12 as number, |
| 17 |
|
| 18 |
/** Hour value for AM/PM conversion (12 noon/midnight) */ |
| 19 |
MERIDIEM_12_HOUR: 12 as number, |
| 20 |
|
| 21 |
/** Minimum minute value (0) */ |
| 22 |
MIN_MINUTE: 0 as number, |
| 23 |
|
| 24 |
/** Maximum minute value (59) */ |
| 25 |
MAX_MINUTE: 59 as number, |
| 26 |
|
| 27 |
/** Number of hours in a day (24) */ |
| 28 |
MIN_HOURS_IN_DAY: 24 as number, |
| 29 |
|
| 30 |
/** Number of minutes per hour (60) */ |
| 31 |
MINUTES_PER_HOUR: 60 as number, |
| 32 |
|
| 33 |
/** Maximum time in minutes since midnight (23:59 = 1439 minutes) */ |
| 34 |
MAX_TIME_IN_MINUTES: (23 * 60 + 59) as number, |
| 35 |
} as const |
| 36 |
|
| 37 |
/** |
| 38 |
* Type-safe access to TIME_CONSTANTS |
| 39 |
*/ |
| 40 |
export type TimeConstants = typeof TIME_CONSTANTS |
| 41 |
|