ptitlutins/app/utils/dayLabel.ts
2026-06-10 23:37:21 +02:00

12 lines
342 B
TypeScript

import { utcDay } from "./utcDay"
/** Localised day heading, e.g. "Samedi 13 juin". */
export const dayLabel = (iso: string): string => {
const s = new Intl.DateTimeFormat("fr-FR", {
weekday: "long",
day: "numeric",
month: "long",
timeZone: "UTC",
}).format(utcDay(iso))
return s.charAt(0).toUpperCase() + s.slice(1)
}