Skip to content

taqwim-core-utilsDocs


taqwim-core-utils / toHijri

Function: toHijri()

toHijri(date)

toHijri(date): object | null

Converts a Gregorian date to Hijri (Islamic) date.

Parameters

date: Date | DateObject

Returns

object | null

An object representing the Hijri date in the format { hy: number; hm: number; hd: number }, or null if the conversion fails.

Throws

If the input is invalid or the conversion fails.

Source

toHijri.ts:11

toHijri(year, month, day)

toHijri(year, month, day): object | null

Converts a Gregorian date to Hijri (Islamic) date.

Parameters

year: number

month: number

The month of the Gregorian date (optional, required if dateOrYear is a number).

day: number

The day of the Gregorian date (optional, required if dateOrYear is a number).

Returns

object | null

An object representing the Hijri date in the format { hy: number; hm: number; hd: number }, or null if the conversion fails.

Throws

If the input is invalid or the conversion fails.

Source

toHijri.ts:12

toHijri(date)

toHijri(date): object | null

Converts a Gregorian date to Hijri (Islamic) date.

Parameters

date: string

Returns

object | null

An object representing the Hijri date in the format { hy: number; hm: number; hd: number }, or null if the conversion fails.

Throws

If the input is invalid or the conversion fails.

Source

toHijri.ts:13

Released under the MIT License.