formatWeekday
Formats the weekday from a Luxon DateTime. Pass false for isLong to use short weekday names in compact layouts.
Importing
ts
import { formatWeekday } from '@almighty-shogun/utils'Usage
ts
import { DateTime } from 'luxon'
import { formatWeekday } from '@almighty-shogun/utils'
const weekday = formatWeekday(DateTime.fromISO('2026-05-20'), true, 'en');Parameters
| Name | Type | Description |
|---|---|---|
date | DateTime | Date to format. |
isLong | boolean | Use long weekday names when true; short names when false. |
locale | string | Optional locale override. |
Returns
A localized weekday name. When isLong is true, the long weekday form is used; when false, the short form is used.
Type signature
ts
declare function formatWeekday(
date: DateTime,
isLong?: boolean,
locale?: string
): string;