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
date: DateTime
Date to format.
isLong?: boolean
Use long weekday names when true; short names when false.
Default: true
locale?: Undefinable<string>
Locale override.
Returns
A localized weekday name. WhenisLong is true, the long weekday form is used; when false, the short form is used.Uses
Type signature
ts
declare function formatWeekday(
date: DateTime,
isLong?: boolean,
locale?: Undefinable<string>
): string;