@ribajs/luxon
Version:
Luxon (time library) module for Riba.js
17 lines (15 loc) • 450 B
text/typescript
import { Formatter } from "@ribajs/core";
import { Duration } from "luxon";
/**
* Returns an ISO 8601-compliant string representation of this Duration.
*/
export const LuxonDurationToISOFormatter: Formatter = {
name: "lx-duration-to-iso",
/**
* @see https://moment.github.io/luxon/docs/class/src/duration.js~Duration.html#instance-method-toISO
* @param target Duration
*/
read(target: Duration) {
return target.toISO();
},
};