hijri-core/.github/wiki/api/functions/toHijri.md

883 B

hijri-core v1.0.1


hijri-core / toHijri

Function: toHijri()

toHijri(date, options?): HijriDate | null

Defined in: index.ts:42

Convert a Gregorian date to a Hijri date.

Uses the UAQ (Umm al-Qura) calendar by default. Pass { calendar: 'fcna' } or any registered calendar name via options to use a different engine.

Parameters

date

Date

a valid JavaScript Date object

options?

ConversionOptions

conversion options (calendar engine selection)

Returns

HijriDate | null

the corresponding Hijri date, or null if the date is out of range

Throws

if date is not a valid Date instance