@ribajs/luxon
Version:
Luxon (time library) module for Riba.js
18 lines (16 loc) • 506 B
text/typescript
import { Formatter } from "@ribajs/core";
import { DateTime } from "luxon";
/**
* Returns true if this DateTime is in a leap year, false otherwise
*/
export const LuxonIsInLeapYearFormatter: Formatter = {
name: "lx-is-in-leap-year",
/**
* @see https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#instance-get-isInLeapYear
* @param target can be a Luxon DateTime object
* @returns boolean
*/
read(target: DateTime): boolean {
return target.isInLeapYear;
},
};