Skip to content
Devix Open Source

Convert a date

Both ways, in three languages, with the offset a ministry publishes — and it tells you when the answer comes from the table and when it does not.

Live preview
<div class="demo">
  <div class="demo-grid-2">
    <div class="demo-field">
      <label class="demo-label" for="gregorian">Gregorian</label>
      <input id="gregorian" class="demo-input" type="date" value="2026-09-12">
    </div>
    <div class="demo-field">
      <label class="demo-label" for="hijri">Hijri</label>
      <input id="hijri" class="demo-input" value="1448-04-01" autocomplete="off">
      <span class="demo-hint">yyyy-mm-dd, or “1 Ramadan 1448”</span>
    </div>
  </div>
  <div class="demo-row">
    <div class="demo-seg" id="locale">
      <button class="is-on" data-locale="en">English</button>
      <button data-locale="ar">العربية</button>
      <button data-locale="ur">اردو</button>
    </div>
    <label class="demo-label" for="offset">Offset
      <select id="offset" class="demo-input">
        <option value="-1">−1 day</option>
        <option value="0" selected>Umm al-Qura</option>
        <option value="1">+1 day</option>
      </select>
    </label>
  </div>
  <p class="demo-out" id="out"></p>
  <p class="demo-hint" id="note"></p>
  <div class="demo-card">
    <p class="demo-hint">Coming up</p>
    <div class="demo-kv" id="events"></div>
  </div>
</div>