Skip to content

Version 0.4.3 is tagged on GitHub and is not published on npm. A beta will be published before the stable 1.0.0.

API reference

Everything each entry point exports.

ngx-mat-hijri-adapter

The adapter, its provider, formatting, and calendar helpers.

ExportKindDescription
HijriDateAdapterclassMaterial DateAdapter for both calendars.
provideHijriDateAdapterfunctionRegisters the adapter, formats, and locale.
ProvideHijriDateAdapterOptionstypeProvider options, including formats.
HIJRI_DATE_ADAPTER_OPTIONStokenAdapter options: calendar, locale, timeZone.
HijriDateAdapterOptionstypeThe shape of the adapter options.
HIJRI_DATE_FORMATSconstantDefault Material format slots.
formatCalendarDatefunctionFormats a date in its own calendar.
CalendarCodeconstantThe supported calendar names.
SupportedCalendartype'gregorian' or 'islamic-umalqura'.
CalendarLocaleconstantThe default locales, ar-SA and en-US.
createCalendarDatefunctionCreates a validated date. Months are 1-based.
convertCalendarDatefunctionConverts a date to another calendar.
calendarOffunctionReads the supported calendar. gregory becomes gregorian.
compareCalendarDatesfunctionOrders two dates.
addCalendarDatefunctionAdds a duration, keeping the Umm al-Qura range.
daysInCalendarMonthfunctionDays in the month of a date.
monthsInCalendarYearfunctionMonths in the year of a date.
calendarTodayfunctionToday in a calendar and time zone.
UMALQURA_MIN_YEARconstant1300.
UMALQURA_MAX_YEARconstant1599.
UmalquraDateRangeErrorclassThrown outside AH 1300–1599.
InvalidCalendarDateErrorclassThrown for a day that does not exist.
NGX_MAT_HIJRI_ADAPTER_VERSIONconstantThe package version.

ngx-mat-hijri-adapter/native

A DateAdapter<Date> that formats with Intl and counts Umm al-Qura days from an in-repo table.

ExportKindDescription
NativeHijriDateAdapterclassMaterial DateAdapter for a JavaScript Date at UTC noon.
provideNativeHijriDateAdapterfunctionRegisters the native adapter, formats, and locale.
ProvideNativeHijriDateAdapterOptionstypeProvider options, including formats.
NativeHijriDateAdapterOptionstypeCalendar, locale, week start, and time zone.
NATIVE_HIJRI_DATE_ADAPTER_OPTIONSconstantInjection token for the native adapter options.

ngx-mat-hijri-adapter/reactive

Fields for reactive forms.

ExportKindDescription
ReactiveDateFieldcomponentngx-mat-reactive-date-field
ReactiveDateRangeFieldcomponentngx-mat-reactive-date-range-field
CalendarDateRangetypeThe value of a range field.
DateFieldLabelstypeLetter labels and accessible names.
CalendarToggleControllertypeContext of a #calendarToggle template.
DateFieldPeriodtype'all', 'past', or 'future'.

ngx-mat-hijri-adapter/signals

Fields for signal forms.

ExportKindDescription
SignalDateFieldcomponentngx-mat-signal-date-field
SignalDateRangeFieldcomponentngx-mat-signal-date-range-field
CalendarDateRangetypeThe value of a range field.
DateFieldLabelstypeLetter labels and accessible names.
CalendarToggleControllertypeContext of a #calendarToggle template.
DateFieldPeriodtype'all', 'past', or 'future'.

Private: ngx-mat-hijri-adapter/internal

/reactive and /signals do not depend on each other. The code they share lives in ngx-mat-hijri-adapter/internal, which is not public API: its exports carry the ɵ prefix and may change in any release. Do not import from it.