arabicfmt
Version:
Arabic-first formatting for numbers, currency, dates and bidirectional text across all 22 Arab League countries — with correct handling of the 2025–2026 Unicode currency-symbol transition (Saudi Riyal U+20C1, UAE Dirham U+20C3, Omani Rial U+20C4).
40 lines (35 loc) • 1.86 kB
text/typescript
import { f as HijriDate, F as FormatHijriOptions } from '../format-BkdDnX9Q.cjs';
export { A as ARABIC_WEEKDAYS_AR, a as ARABIC_WEEKDAYS_EN, G as GREGORIAN_MONTHS_AR, b as GREGORIAN_MONTHS_EN, H as HIJRI_ERA_AR, c as HIJRI_ERA_EN, d as HIJRI_MONTHS_AR, e as HIJRI_MONTHS_EN, g as formatHijriDate } from '../format-BkdDnX9Q.cjs';
import '../types-CK7PVYeU.cjs';
/** Convert a Gregorian `Date` to a tabular Hijri date. */
declare function toHijri(date: Date): HijriDate;
/** Convert a tabular Hijri date to a Gregorian `Date` (UTC midnight). */
declare function fromHijri(year: number, month: number, day: number): Date;
/**
* Julian Day Number helpers (proleptic Gregorian, date-only / integer JDN).
*
* These are the shared bridge between the Gregorian calendar and both Hijri
* engines. All conversions are done in UTC so they never depend on the host
* timezone.
*/
/** Gregorian Y/M/D → integer Julian Day Number (Fliegel–Van Flandern). */
declare function gregorianToJDN(year: number, month: number, day: number): number;
/** Integer Julian Day Number → Gregorian Y/M/D. */
declare function jdnToGregorian(jdn: number): {
year: number;
month: number;
day: number;
};
/** `Date` → integer JDN, reading the date's UTC fields. */
declare function dateToJDN(date: Date): number;
/** Integer JDN → `Date` at UTC midnight. */
declare function jdnToDate(jdn: number): Date;
/**
* Convert a Gregorian `Date` to a Hijri string in one call, using the tabular
* calendar. For official Umm al-Qura dates use `formatHijri` from
* `arabicfmt/umalqura`.
*
* @example formatHijri(new Date("2025-09-23"), { numerals: "arab" })
*/
declare function formatHijri(date: Date, options?: FormatHijriOptions): string;
export { FormatHijriOptions, HijriDate, dateToJDN, formatHijri, fromHijri, gregorianToJDN, jdnToDate, jdnToGregorian, toHijri };