@date-io/date-fns
Advanced tools
Comparing version 2.4.0 to 2.5.0
@@ -13,2 +13,3 @@ import { IUtils, DateIOFormats } from "@date-io/core/IUtils"; | ||
addDays(value: Date, count: number): Date; | ||
addMonths(value: Date, count: number): Date; | ||
isValid(value: any): boolean; | ||
@@ -46,2 +47,3 @@ getDiff(value: Date, comparing: Date | string): number; | ||
isAfterYear(date: Date, value: Date): boolean; | ||
isWithinRange(date: Date, [start, end]: [Date, Date]): boolean; | ||
formatNumber(numberToFormat: string): string; | ||
@@ -48,0 +50,0 @@ getMinutes(date: Date): number; |
@@ -32,2 +32,3 @@ import addDays from 'date-fns/addDays'; | ||
import startOfYear from 'date-fns/startOfYear'; | ||
import isWithinInterval from 'date-fns/isWithinInterval'; | ||
@@ -82,2 +83,5 @@ var defaultFormats = { | ||
}; | ||
DateFnsUtils.prototype.addMonths = function (value, count) { | ||
return addMonths(value, count); | ||
}; | ||
DateFnsUtils.prototype.isValid = function (value) { | ||
@@ -191,2 +195,6 @@ return isValid(this.date(value)); | ||
}; | ||
DateFnsUtils.prototype.isWithinRange = function (date, _a) { | ||
var start = _a[0], end = _a[1]; | ||
return isWithinInterval(date, { start: start, end: end }); | ||
}; | ||
DateFnsUtils.prototype.formatNumber = function (numberToFormat) { | ||
@@ -193,0 +201,0 @@ return numberToFormat; |
@@ -36,2 +36,3 @@ 'use strict'; | ||
var startOfYear = _interopDefault(require('date-fns/startOfYear')); | ||
var isWithinInterval = _interopDefault(require('date-fns/isWithinInterval')); | ||
@@ -86,2 +87,5 @@ var defaultFormats = { | ||
}; | ||
DateFnsUtils.prototype.addMonths = function (value, count) { | ||
return addMonths(value, count); | ||
}; | ||
DateFnsUtils.prototype.isValid = function (value) { | ||
@@ -195,2 +199,6 @@ return isValid(this.date(value)); | ||
}; | ||
DateFnsUtils.prototype.isWithinRange = function (date, _a) { | ||
var start = _a[0], end = _a[1]; | ||
return isWithinInterval(date, { start: start, end: end }); | ||
}; | ||
DateFnsUtils.prototype.formatNumber = function (numberToFormat) { | ||
@@ -197,0 +205,0 @@ return numberToFormat; |
{ | ||
"name": "@date-io/date-fns", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "Abstraction over common javascript date management libraries", | ||
@@ -36,10 +36,10 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@date-io/core": "^2.4.0" | ||
"@date-io/core": "^2.5.0" | ||
}, | ||
"devDependencies": { | ||
"date-fns": "2.9.0", | ||
"rollup": "^1.27.7", | ||
"date-fns": "2.11.0", | ||
"rollup": "^2.0.2", | ||
"typescript": "^3.7.2" | ||
}, | ||
"gitHead": "d1b13999d15fce1c7b06d20654f1867ec6a7e096" | ||
"gitHead": "c6fc999bc503c79a913c2fd51a4bbce4427694d5" | ||
} |
@@ -32,3 +32,5 @@ import addDays from "date-fns/addDays"; | ||
import startOfYear from "date-fns/startOfYear"; | ||
import isWithinRange from "date-fns/isWithinInterval"; | ||
import { IUtils, DateIOFormats } from "@date-io/core/IUtils"; | ||
import isWithinInterval from "date-fns/isWithinInterval"; | ||
@@ -95,2 +97,6 @@ type Locale = typeof import("date-fns/locale/en-US").default; | ||
public addMonths(value: Date, count: number) { | ||
return addMonths(value, count); | ||
} | ||
public isValid(value: any) { | ||
@@ -240,2 +246,6 @@ return isValid(this.date(value)); | ||
public isWithinRange(date: Date, [start, end]: [Date, Date]) { | ||
return isWithinInterval(date, { start, end }); | ||
} | ||
public formatNumber(numberToFormat: string) { | ||
@@ -242,0 +252,0 @@ return numberToFormat; |
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
34793
879
Updated@date-io/core@^2.5.0