taqwim-core-utils • Docs
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(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(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.