UNPKG

@ribajs/luxon

Version:

Luxon (time library) module for Riba.js

18 lines (16 loc) 418 B
import { Formatter } from "@ribajs/core"; import { Duration } from "luxon"; /** * Get the hours. */ export const LuxonDurationHoursFormatter: Formatter = { name: "lx-interval-hours", /** * @see https://moment.github.io/luxon/docs/class/src/duration.js~Duration.html#instance-get-hours * @param target Interval * @returns number */ read(target: Duration): number { return target.hours; }, };