Hebrew year in which to find the anniversary
Gregorian or Hebrew date of the original event
anniversary occurring in hyear as a Gregorian date, or
undefined when hyear precedes the original year
Use birthdayOrAnniversary instead, which returns
an HDate. Returning a Gregorian Date loses the Hebrew date that
was actually computed and invites a needless conversion back again;
call .greg() on the result if you really do want a Date.
import {getBirthdayOrAnniversary} from '@hebcal/hdate';
const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
const anniversary = getBirthdayOrAnniversary(5780, dt); // '3/26/2020' == '1 Nisan 5780'
HDate
Calculates a birthday or anniversary (non-yahrzeit) and converts the result to a Gregorian
Date.See getBirthdayHD for a description of the algorithm.