UNPKG

@ribajs/luxon

Version:

Luxon (time library) module for Riba.js

18 lines (16 loc) 528 B
import { Formatter } from "@ribajs/core"; import { DateTime } from "luxon"; /** * Return an Interval spanning between this DateTime and another DateTime */ export const LuxonUntilFormatter: Formatter = { name: "lx-until", /** * @see https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#instance-method-until * @param target can be a Luxon DateTime object * @param otherDateTime DateTime */ read(target: DateTime, otherDateTime: DateTime) { return target.until(otherDateTime); }, };