@ribajs/luxon
Version:
Luxon (time library) module for Riba.js
19 lines (17 loc) • 528 B
text/typescript
import { Formatter } from "@ribajs/core";
import { DateTime } from "luxon";
/**
* Return the max of several date times
*/
export const LuxonMaxFormatter: Formatter = {
name: "lx-max",
/**
* @see https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#static-method-max
* @param target can be a Luxon DateTime object
* @param ...dateTimes DateTime[]
* @returns DateTime
*/
read(target: DateTime, ...dateTimes: DateTime[]): DateTime {
return DateTime.max(target, ...dateTimes);
},
};