Function: subHijriYears()
@taqwim/core / subHijriYears
subHijriYears(
date,amount):HijriDateObject
Defined in: packages/core/src/lib/subHijriYears.ts:26
Adds a specified number of years to a Hijri date.
Parameters
Section titled “Parameters”HijriDateObject
The Hijri date object to substract years to.
amount
Section titled “amount”number
The number of years to sub.
Returns
Section titled “Returns”HijriDateObject
The resulting Hijri date object after subing the specified number of years, or null if the input date is invalid.
Examples
Section titled “Examples”// Substract 10 years from 1 Ramadan 1445 ({ hy: 1445, hm: 9, hd: 1 })const result = subHijriYears({ hy: 1445, hm: 9, hd: 1 },10);//=> { hy: 1435, hm: 9, hd: 1 }// Substract 1 year to 1 Ramadan 1445 ({ hy: 1445, hm: 9, hd: 30 }) and adjust the monthconst result = subHijriYears({ hy: 1445, hm: 9, hd: 30 },1);//=> { hy: 1444, hm: 9, hd: 29 }