12 lines
342 B
TypeScript
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)
|
|
}
|