Calculate the day of the week for a specific date. Whether it’s a historical event, an upcoming appointment, or the day you were born, find out which day of the week a certain event took place.
export const take = [{ type: "date" }]
export const make = (date) => {
if (!date) return
return { type: "card", value: toDay(date), detail: toDate(date) }
}
const toDay = new Intl.DateTimeFormat(undefined, {
weekday: "long",
}).format
const toDate = new Intl.DateTimeFormat(undefined, {
year: "numeric",
day: "numeric",
month: "long",
}).format