Skip to content

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

NameTypeDescription
dateDateTimeDate to format.
isLongbooleanUse long weekday names when true; short names when false.
localestringOptional 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;

All packages are released under the MIT License.