ts-type-forge
    Preparing search index...

    Type Alias MonthEnum

    MonthEnum: Exclude<Index<13>, 0>

    Represents the months of the year using 1-based indexing. A union of integer literals from 1 (January) to 12 (December).

    This follows the common human-readable convention where January = 1, unlike JavaScript's Date object which uses 0-based month indexing.

    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