Function: formatHijriDate()
@taqwim/core / formatHijriDate
formatHijriDate(
hijriDate,formatStr,locale):string
Defined in: packages/core/src/lib/formatHijriDate.ts:39
Formats a Hijri date based on the provided format string.
Parameters
Section titled “Parameters”hijriDate
Section titled “hijriDate”The Hijri date object containing the year, month, and day.
number
number
number
formatStr
Section titled “formatStr”string
The format string specifying how the Hijri date should be formatted.
locale
Section titled “locale”string = 'en'
The locale to use for formatting the date. Defaults to “en”.
Returns
Section titled “Returns”string
The formatted Hijri date as a string.
Examples
Section titled “Examples”formatHijriDate({ hy: 1443, hm: 3, hd: 10 }, "iYYYY/iMM/iDD", "ar");//=> "1443/03/10"formatHijriDate({ hy: 1443, hm: 3, hd: 10 }, "iD iMMM, iYYYY", "en");//=> "10 Rabiʻ II, 1443"formatHijriDate({ hy: 1443, hm: 3, hd: 10 }, "iEEEE, iD iMMMM iYYYY", "ar");//=> "الأحد, 10 جمادى الثاني 1443"formatHijriDate({ hy: 1443, hm: 3, hd: 10 }, "iE, iD iMMM iYYYY", "en");//=> "7, 10 Rabiʻ II 1443"formatHijriDate({ hy: 1443, hm: 3, hd: 10 }, "iD iMMM, iYYYY", "fr");//=> "10 Rabiʻ II, 1443"formatHijriDate({ hy: 1443, hm: 3, hd: 10 }, "iD iMMM, iYYYY", "ar");//=> "10 ربيع الثاني, 1443"formatHijriDate({ hy: 1443, hm: 3, hd: 10 }, "iD iMMM, iYYYY", "en");//=> "10 Rabiʻ II, 1443"