Function: subHijriMonths()
@taqwim/core / subHijriMonths
subHijriMonths(
date,amount):HijriDateObject
Defined in: packages/core/src/lib/subHijriMonths.ts:34
Substracts a specified number of Months from a Hijri date.
Parameters
Section titled “Parameters”HijriDateObject
The Hijri date object to sub Months to.
amount
Section titled “amount”number
The number of Months to sub.
Returns
Section titled “Returns”HijriDateObject
The resulting Hijri date object after subing the specified number of Months, or null if the input date is invalid.
Examples
Section titled “Examples”// Substract 10 Months to 1 Ramadan 1445 ({ hy: 1445, hm: 9, hd: 1 })const result = subHijriMonths({ hy: 1445, hm: 9, hd: 1 },10);//=> { hy: 1444, hm: 11, hd: 1 }// Substract 1 Month from 30 Ramadan 1445 ({ hy: 1445, hm: 9, hd: 30 })const result = subHijriMonths({ hy: 1445, hm: 9, hd: 30 },1);//=> { hy: 1445, hm: 8, hd: 29 }// Substract 26 Months from 30 Ramadan 1445 ({ hy: 1445, hm: 9, hd: 30 })const result = subHijriMonths({ hy: 1447, hm: 12, hd: 29 },26);//=> { hy: 1445, hm: 9, hd: 30 }