schemaglobin
Advanced tools
Comparing version 5.2.0 to 5.3.0
@@ -62,1 +62,5 @@ /** Is a value a date? */ | ||
export declare const formatDate: (date: PossibleDate, options?: Intl.DateTimeFormatOptions | undefined) => string; | ||
/** Is a date in the past? */ | ||
export declare const inPast: (targetDate: PossibleDate, currentDate?: PossibleDate) => boolean; | ||
/** Is a date in the future? */ | ||
export declare const inFuture: (targetDate: PossibleDate, currentDate?: PossibleDate) => boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatDate = exports.formatShortAgo = exports.formatAgo = exports.formatShortUntil = exports.formatUntil = exports.formatWhen = exports.weeksAgo = exports.weeksUntil = exports.daysAgo = exports.daysUntil = exports.secondsAgo = exports.secondsUntil = exports.addHours = exports.addDays = exports.getMonday = exports.getMidnight = exports.getDow = exports.days = exports.getYmd = exports.makeDate = exports.isDate = void 0; | ||
exports.inFuture = exports.inPast = exports.formatDate = exports.formatShortAgo = exports.formatAgo = exports.formatShortUntil = exports.formatUntil = exports.formatWhen = exports.weeksAgo = exports.weeksUntil = exports.daysAgo = exports.daysUntil = exports.secondsAgo = exports.secondsUntil = exports.addHours = exports.addDays = exports.getMonday = exports.getMidnight = exports.getDow = exports.days = exports.getYmd = exports.makeDate = exports.isDate = void 0; | ||
const number_1 = require("./number"); | ||
@@ -149,1 +149,5 @@ /** Is a value a date? */ | ||
exports.formatDate = (date, options) => new Intl.DateTimeFormat(undefined, options).format(exports.makeDate(date)); | ||
/** Is a date in the past? */ | ||
exports.inPast = (targetDate, currentDate = new Date()) => exports.makeDate(targetDate) < exports.makeDate(currentDate); | ||
/** Is a date in the future? */ | ||
exports.inFuture = (targetDate, currentDate = new Date()) => exports.makeDate(targetDate) > exports.makeDate(currentDate); |
{ | ||
"name": "schemaglobin", | ||
"description": "Validate user-entered data.", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"repository": "https://github.com/dhoulb/schemaglobin", | ||
@@ -6,0 +6,0 @@ "author": "Dave Houlbrooke <dave@shax.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149812
2796