UNPKG

@ribajs/luxon

Version:

Luxon (time library) module for Riba.js

17 lines (15 loc) 465 B
import { Formatter } from "@ribajs/core"; import { Duration } from "luxon"; /** * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. */ export const LuxonDurationToJSONFormatter: Formatter = { name: "lx-duration-to-json", /** * @see https://moment.github.io/luxon/docs/class/src/duration.js~Duration.html#instance-method-toJSON * @param target Duration */ read(target: Duration) { return target.toJSON(); }, };