@hebcal/hdate
    Preparing search index...

    Function getBirthdayHD

    • Same calculation as getBirthdayOrAnniversary, but returns the result as a SimpleHebrewDate ({yy, mm, dd}) rather than converting to a Gregorian Date. Useful when the caller needs the Hebrew date directly (e.g. for rendering with gematriya or further Hebrew-calendar arithmetic) and wants to avoid an extra R.D. → Gregorian round-trip.

      See getBirthdayOrAnniversary for the full description of the algorithm and edge cases (Adar / Adar II, and the 30th of Marcheshvan, Kislev, or Adar I).

      Parameters

      • hyear: number

        Hebrew year in which to find the anniversary

      • date: AnniversaryDate

        Gregorian or Hebrew date of the original event

      Returns SimpleHebrewDate | undefined

      anniversary occurring in hyear, or undefined when hyear precedes the original year

      import {getBirthdayHD} from '@hebcal/hdate';
      const dt = new Date(2014, 2, 2); // 30 Adar I 5774
      getBirthdayHD(5780, dt); // {yy: 5780, mm: 1, dd: 1} (1 Nisan)