@ribajs/luxon
Version:
Luxon (time library) module for Riba.js
18 lines (16 loc) • 455 B
text/typescript
import { Formatter } from "@ribajs/core";
import { DateTime, Zone } from "luxon";
/**
* Get the time zone associated with this DateTime.
*/
export const LuxonZoneFormatter: Formatter = {
name: "lx-zone",
/**
* @see https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#instance-get-zone
* @param target can be a Luxon DateTime object
* @returns Zone
*/
read(target: DateTime): Zone {
return target.zone;
},
};