// hijriah.js — use Aladhan API to convert g->h for today
export async function fetchHijriForToday() {
  try {
    const now = new Date();
    const dateStr = `${now.getDate()}-${now.getMonth()+1}-${now.getFullYear()}`;
    const res = await fetch(`https://api.aladhan.com/v1/gToH?date=${dateStr}`);
    const data = await res.json();
    return data?.data?.hijri ?? null;
  } catch (e) {
    console.warn("fetchHijriForToday failed", e);
    return null;
  }
}
