/**
 * A notification's delivery date in the reader's language (it was always US
 * English, so an Arabic reader saw «November 8, 2026»). Kuwait time and
 * Western digits, like every other date in the product.
 */
export function formatNotificationDate(timestamp: string, language = "ar"): string {
  const date = new Date(timestamp);
  if (!Number.isFinite(date.getTime())) return "";
  return new Intl.DateTimeFormat(language === "ar" ? "ar-KW-u-nu-latn" : "en-GB", {
    timeZone: "Asia/Kuwait",
    month: "long",
    day: "numeric",
    year: "numeric",
  }).format(date);
}
