Skip to content

Function: addHijriWeeks()

@taqwim/core


@taqwim/core / addHijriWeeks

addHijriWeeks(date, amount): HijriDateObject

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

Adds a specified number of weeks to a Hijri date.

HijriDateObject

The Hijri date object to add weeks to.

number

The number of weeks to add.

HijriDateObject

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

// Add 10 weeks to 1 Ramadan 1445 ({ hy: 1445, hm: 9, hd: 1 })
const result = addHijriWeeks(
{ hy: 1445, hm: 9, hd: 1 },
10
);
//=> { hy: 1445, hm: 11, hd: 12 }