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

    Function getFestivalsInYear

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

    • Get all festivals in a Gregorian year

      Returns all festivals for the specified year, filtered by the locale's region and sorted by Gregorian date. Festivals without a localized name for the requested locale are excluded.

      Parameters

      • config: CalendarConfig

        Calendar configuration

      • gyear: number

        Gregorian year

      • locale: string = 'zh-CN'

        Locale code (default: 'zh-CN')

      Returns { date: GregorianDate; key: string; name: string }[]

      Array of festival objects with name, key, and Gregorian date

      getFestivalsInYear(CHINESE_CONFIG, 2024, 'zh-CN')
      // [{ name: "腊八节", key: "laba", date: { year: 2024, month: 1, day: 18 } }, ...]

      getFestivalsInYear(CHINESE_CONFIG, 2024, 'zh-HK')
      // [{ name: "臘八節", key: "laba", date: { year: 2024, month: 1, day: 18 } }, ...]