/** `YYYY-MM-DD` in local time, never UTC. */
export function localDateISO(d: Date): string {
  const y = d.getFullYear();
  const m = String(d.getMonth() + 1).padStart(2, "0");
  const day = String(d.getDate()).padStart(2, "0");
  return `${y}-${m}-${day}`;
}

/** Returns today's date as an ISO date string (YYYY-MM-DD) in local time. */
export function todayISO(): string {
  return localDateISO(new Date());
}
