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

    Function getFestivalDate

    Traditional lunar calendar festivals with region-aware naming. Different regions may observe different festivals or use different names.

    • Get the Gregorian date of a specific festival in a given year

      Parameters

      • config: CalendarConfig

        Calendar configuration

      • key: string

        Festival key (e.g., 'spring', 'mid-autumn', 'new-year-eve')

      • gyear: number

        Gregorian year

      Returns GregorianDate | null

      Gregorian date of the festival, or null if the key is not found

      getFestivalDate(CHINESE_CONFIG, 'spring', 2024)       // { year: 2024, month: 2, day: 10 }
      getFestivalDate(CHINESE_CONFIG, 'mid-autumn', 2024) // { year: 2024, month: 9, day: 17 }
      getFestivalDate(CHINESE_CONFIG, 'new-year-eve', 2024) // { year: 2025, month: 1, day: 28 }