chinese-lunar-date API - v1.0.5
    Preparing search index...

    Interface CalendarConfig

    Calendar configuration (epoch + timezone rules)

    Each lunar calendar variant differs in its epoch year and timezone offset history. The timezone offset affects the calculation of midnight, which determines which calendar day a given astronomical event falls on.

    Why does timezone matter? A new moon or solstice is an astronomical instant. Whether it falls on "today" or "yesterday" depends on the local timezone. For example, a new moon at 23:30 UTC+8 is still the same day in China, but would be "yesterday" in UTC+9 (Japan). This can cause different leap month assignments between the Chinese and Japanese calendars.

    import { CHINESE_CONFIG, JAPANESE_CONFIG } from 'chinese-lunar-date'

    CHINESE_CONFIG.epochYear // -2636 (Chalmers epoch)
    CHINESE_CONFIG.type // "chinese"

    JAPANESE_CONFIG.epochYear // -2636 (same epoch, different timezone)
    JAPANESE_CONFIG.type // "japanese"
    interface CalendarConfig {
        epochJDE: number;
        epochYear: number;
        timeshiftUTC: (year: number, month: number, day: number) => number;
        type: CalendarType;
    }
    Index

    Properties

    epochJDE: number

    Epoch JDE (Julian Ephemeris Day of the epoch new year)

    epochYear: number

    Epoch year (Gregorian). The year from which the 60-year cycle count begins.

    • Chinese: -2636 (Chalmers epoch)
    • Korean: -2333 (Dangun epoch)
    timeshiftUTC: (year: number, month: number, day: number) => number

    UTC offset in fraction of day, given a Gregorian date. This function accounts for historical timezone changes. For example, China switched from UTC+7:45:40 to UTC+8 in 1929.

    Type Declaration

      • (year: number, month: number, day: number): number
      • Parameters

        • year: number

          Gregorian year

        • month: number

          Month (1-12)

        • day: number

          Day of month

        Returns number

        UTC offset as a fraction of a day (e.g., 8/24 for UTC+8)

    Calendar type