Skip to content

formatDateTime

Formats a Luxon DateTime with weekday, day, month, hour, and minute. Use it for event labels, appointment times, and timeline entries where both the day and time matter.

Importing

ts
import { formatDateTime } from '@almighty-shogun/utils'

Usage

ts
import { DateTime } from 'luxon'
import { formatDateTime } from '@almighty-shogun/utils'

const label = formatDateTime(DateTime.fromISO('2026-05-20T14:30:00'), 'en');

Parameters

NameTypeDescription
dateDateTimeDate and time to format.
localestringOptional locale override.

Returns

A localized date-time label containing weekday, day, month, hour, and minute. The exact punctuation and ordering come from Luxon and the active locale.

Type signature

ts
declare function formatDateTime(
    date: DateTime,
    locale?: string
): string;

All packages are released under the MIT License.