Skip to content

Function: subHijriBusinessDays()

@taqwim/core


@taqwim/core / subHijriBusinessDays

subHijriBusinessDays(date, amount, options): HijriDateObject

Defined in: packages/core/src/lib/subHijriBusinessDays.ts:26

HijriDateObject

The date to be changed

number

The amount of business days to be subtracted.

BusinessDayOptions = {}

Business-day options, e.g. { weekend: [6, 0] } for a Sat/Sun weekend.

HijriDateObject

The new date with the business days subtracted, or null if date is invalid.

subHijriBusinessDays

Subtract the specified number of business days from the given date, skipping weekend days. The weekend defaults to Friday/Saturday — the working week across most of the Arab world — and is configurable.

// Subtract 10 business days from 1 Ramadan 1445
subHijriBusinessDays({ hy: 1445, hm: 9, hd: 1 }, 10)
//=> { hy: 1445, hm: 8, hd: 16 }