UNPKG

@ribajs/luxon

Version:

Luxon (time library) module for Riba.js

18 lines (16 loc) 482 B
import { Formatter } from "@ribajs/core"; import { DateTime } from "luxon"; /** * Get the human readable short weekday, such as 'Mon'. */ export const LuxonWeekdayShortFormatter: Formatter = { name: "lx-weekday-short", /** * @see https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#instance-get-weekdayShort * @param target can be a Luxon DateTime object * @returns string */ read(target: DateTime) { return target.weekdayShort; }, };