@ribajs/luxon
Version:
Luxon (time library) module for Riba.js
17 lines (15 loc) • 600 B
text/typescript
import { Formatter } from "@ribajs/core";
import { DateTime } from "luxon";
/**
* Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". Defaults to the system's locale if no locale has been specified
*/
export const LuxonOffsetNameLongFormatter: Formatter = {
name: "lx-offset-name-long",
/**
* @see https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#instance-get-offsetNameLong
* @param target can be a Luxon DateTime object
*/
read(target: DateTime) {
return target.offsetNameLong;
},
};