kalkal is a zero-dependency, client-side date converter built entirely with arithmetic algorithms. All conversions are deterministic, reproducible, and independently verifiable.
Julian Day Number as Universal Pivot
All date conversions in kalkal pass through the Julian Day Number (JDN) — a continuous count of days since the beginning of the Julian Period on 1 January 4713 BCE (Julian proleptic calendar). Each calendar system implements two functions: one to convert a date into a JDN, and one to convert a JDN back into a date in that calendar. To convert from calendar A to calendar B, we compute A → JDN → B. This approach avoids the combinatorial explosion of writing direct conversion functions between every pair of calendars.
Architecture and Construction
kalkal runs entirely in the browser with zero external dependencies and no build step. The computational engine is a single JavaScript module (Cal) exposing toJD() and fromJD() functions for each of the 24 supported calendar systems. A separate registry maps each calendar to its Cal functions, handling UI concerns like variant selection (e.g. the 4 tabular Hijri variants, 3 Byzantine Anno Mundi variants, 2 Seleucid reckonings) independently from the algorithms. Internationalization covers 4 languages (EN, PL, AR, EO) with full RTL support for Arabic.
Nearly all algorithms are purely arithmetic — no astronomical calculations, no external API calls, no lookup tables of observed data. The one exception is the Babylonian calendar, which uses the Parker & Dubberstein observational tables for 626 BCE–45 CE (with an arithmetic fallback outside that range). For all other calendars, every conversion is reproducible: the same input always produces the same output regardless of platform, locale, or network state.
Algorithm Sources
Gregorian and Julian conversions follow the algorithms in Meeus (1998). The tabular Hijri calendar uses a 30-year cycle with 4 historical leap-year variants (IIc/Wüstenfeld as default). The Solar Hijri uses the 2820-year arithmetic cycle from Birashk, refined by Borkowski; the Ilkhanid (Khānī) calendar shares this algorithm with a different epoch (1302 CE), supplemented by the 12-year Turkic-Mongol animal cycle. Coptic, Ethiopian, Egyptian, Yazdgerdi, and Armenian calendars use epoch-offset arithmetic from Reingold & Dershowitz (2018). The Hebrew calendar implements the full molad-based rules from the same source. The Babylonian calendar uses the Hebrew calendar's molad arithmetic as an approximation, with Nisan-based year start and Nabonassar era offset (747 BCE); historical Babylonian months began at observed first crescent, so this approximation may differ by ±1 day. Byzantine (3 Anno Mundi variants: Constantinople, Alexandrian, Chronicon Paschale), Seleucid (Macedonian and Babylonian reckonings), Antiochene, Syriac, Rumi, AUC, Roman, Spanish Era, Olympiad, and Macedonian calendars are Julian-based with epoch offsets. The Roman calendar adds traditional day notation (Kalends, Nones, Ides). The 15-year Indiction cycle is displayed alongside Byzantine dates.
Validation and Verification
Every calendar conversion is validated through three independent methods. First, round-trip testing: for each calendar, a date is converted to JDN and back, confirming that fromJD(toJD(date)) === date across hundreds of test cases spanning epochs, boundaries, and modern dates. Second, cross-verification against independent implementations: the Fourmilab algorithm (public domain), the browser's Intl.DateTimeFormat API, and Python's hijri-converter library. Third, spot-checking known historical dates (e.g. Battle of Badr = 17 Ramadan 2 AH = 13 March 624 CE Julian, Fall of Baghdad = 10 February 1258 CE) against published scholarly sources.
Tests run in Node.js by loading the browser-targeted Cal module. No test framework is used — the verification scripts output pass/fail counts directly, making the test suite itself auditable with zero dependencies.
Sources and References
- Richards, E. G. Mapping Time: The Calendar and its History. Oxford University Press, 1998.
- Reingold, Edward M. & Dershowitz, Nachum. Calendrical Calculations: The Ultimate Edition. Cambridge University Press, 2018.
- Meeus, Jean. Astronomical Algorithms. 2nd ed. Willmann-Bell, 1998.
- Borkowski, K. M. "ELP2000-85 and the Dynamical Time – Universal Time relation." Astronomy and Astrophysics, 205 (1988), L8–L10.
- de Blois, François. "Taʿrīkh" (chronology section) in Encyclopaedia of Islam, 2nd ed.
- Birashk, Ahmad. A Comparative Calendar of the Iranian, Muslim Lunar, and Christian Eras for Three Thousand Years. Mazda Publishers, 1993.
Coverage and Similar Tools
kalkal supports 24 calendar systems, with a particular focus on historical Near Eastern and ancient calendars absent from other multi-calendar converters. Among the surveyed tools below, none include the Byzantine, Seleucid, Syriac, Macedonian, Antiochene, AUC (Ab Urbe Condita), Spanish Era, or Olympiad calendars; only the Utrecht converter offers the Rumi and ancient Egyptian calendars alongside kalkal. kalkal also offers 4 tabular Hijri variants, 3 Byzantine Anno Mundi variants (Constantinople, Alexandrian, Chronicon Paschale), and 2 Seleucid variants (Macedonian, Babylonian). Among surveyed tools, only the Utrecht University converter offers more Hijri variants (8).
| Calendar | kalkal | Fourmilab | CalendarHome | Episteme | Utrecht | Muqawwim | Cal-Conv |
|---|---|---|---|---|---|---|---|
| Hijri (tabular) | 4 | 1 | 1 | 1 | 8 | 1 | 1 |
| Gregorian | |||||||
| Julian | |||||||
| Hebrew | |||||||
| Solar Hijri | |||||||
| Coptic | |||||||
| Ethiopian | |||||||
| Armenian | |||||||
| Yazdgerdi | |||||||
| Ilkhanid (Khānī) | |||||||
| Byzantine (AM) | 3 | ||||||
| Seleucid | 2 | ||||||
| Babylonian | |||||||
| Syriac | |||||||
| Rumi | |||||||
| Macedonian | |||||||
| Egyptian (ancient) | |||||||
| Roman | |||||||
| AUC | |||||||
| Spanish Era | |||||||
| Antiochene Era | |||||||
| Olympiad | |||||||
| Before Present | |||||||
| Human Era | |||||||
| French Republican | |||||||
| Indian Civil | |||||||
| Mayan | |||||||
| Baháʾí | |||||||
| Kurdish | |||||||
| Afghan | |||||||
| Chinese | |||||||
| Attic (Athenian) | |||||||
| Hindu | |||||||
| Japanese | |||||||
| Nepali | |||||||
| Roman | |||||||
| Minguo | |||||||
| Thai Solar |
- Fourmilab Calendar ConverterJohn Walker's classic multi-calendar converter (~8–11 calendars)
- CalendarHome Convert-a-DateMulti-calendar reference and conversion tools (~11 calendars)
- Episteme AcademyMulti-calendar converter including Chinese, Attic, and Hindu calendars (19 calendars)
- Utrecht University / van GentIslamic–Western converter with 8 tabular Hijri variants (7 calendars)
- MuqawwimCalendar converter for Near East historians (6 calendars)
- Calendar-Converter.comMulti-calendar converter with Minguo and Thai Solar (10 calendars)
- IslamicFinderHijri–Gregorian converter with prayer times
- HebcalHebrew–Gregorian date converter
- Iran ChamberSolar Hijri / Iranian calendar converter