const getMonthName = (month: MonthEnum): string => {
const names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
return names[month - 1]; // Convert to 0-based for array access
};
type January = 1 satisfies MonthEnum;
type December = 12 satisfies MonthEnum;
// type Invalid = 13; // Error: not assignable to MonthEnum
Represents the months of the year using 1-based indexing. A union of integer literals from
1(January) to12(December).This follows the common human-readable convention where January = 1, unlike JavaScript's Date object which uses 0-based month indexing.