Skip to content

Function: subHijriWeeks()

@taqwim/core


@taqwim/core / subHijriWeeks

subHijriWeeks(date, amount): HijriDateObject

Defined in: packages/core/src/lib/subHijriWeeks.ts:19

Substracts a specified number of weeks from a Hijri date.

HijriDateObject

The Hijri date object to sub weeks to.

number

The number of weeks to sub.

HijriDateObject

The resulting Hijri date object after subing the specified number of weeks, or null if the input date is invalid.

// Substract 10 weeks from 1 Ramadan 1445 ({ hy: 1445, hm: 9, hd: 1 })
const result = subHijriWeeks(
{ hy: 1445, hm: 11, hd: 12 },
10
);
//=> { hy: 1445, hm: 9, hd: 1 }