@date-io/dayjs
Advanced tools
Comparing version 2.10.0 to 2.10.1
@@ -39,3 +39,7 @@ import defaultDayjs from "dayjs"; | ||
getHours(date: Dayjs): number; | ||
addSeconds(date: Dayjs, count: number): defaultDayjs.Dayjs; | ||
addMinutes(date: Dayjs, count: number): defaultDayjs.Dayjs; | ||
addHours(date: Dayjs, count: number): defaultDayjs.Dayjs; | ||
addDays(date: Dayjs, count: number): defaultDayjs.Dayjs; | ||
addWeeks(date: Dayjs, count: number): defaultDayjs.Dayjs; | ||
addMonths(date: Dayjs, count: number): defaultDayjs.Dayjs; | ||
@@ -42,0 +46,0 @@ setMonth(date: Dayjs, count: number): defaultDayjs.Dayjs; |
@@ -143,5 +143,21 @@ import defaultDayjs from 'dayjs'; | ||
}; | ||
DayjsUtils.prototype.addSeconds = function (date, count) { | ||
return count < 0 | ||
? date.subtract(Math.abs(count), "second") | ||
: date.add(count, "second"); | ||
}; | ||
DayjsUtils.prototype.addMinutes = function (date, count) { | ||
return count < 0 | ||
? date.subtract(Math.abs(count), "minute") | ||
: date.add(count, "minute"); | ||
}; | ||
DayjsUtils.prototype.addHours = function (date, count) { | ||
return count < 0 ? date.subtract(Math.abs(count), "hour") : date.add(count, "hour"); | ||
}; | ||
DayjsUtils.prototype.addDays = function (date, count) { | ||
return count < 0 ? date.subtract(Math.abs(count), "day") : date.add(count, "day"); | ||
}; | ||
DayjsUtils.prototype.addWeeks = function (date, count) { | ||
return count < 0 ? date.subtract(Math.abs(count), "week") : date.add(count, "week"); | ||
}; | ||
DayjsUtils.prototype.addMonths = function (date, count) { | ||
@@ -148,0 +164,0 @@ return count < 0 ? date.subtract(Math.abs(count), "month") : date.add(count, "month"); |
@@ -152,5 +152,21 @@ 'use strict'; | ||
}; | ||
DayjsUtils.prototype.addSeconds = function (date, count) { | ||
return count < 0 | ||
? date.subtract(Math.abs(count), "second") | ||
: date.add(count, "second"); | ||
}; | ||
DayjsUtils.prototype.addMinutes = function (date, count) { | ||
return count < 0 | ||
? date.subtract(Math.abs(count), "minute") | ||
: date.add(count, "minute"); | ||
}; | ||
DayjsUtils.prototype.addHours = function (date, count) { | ||
return count < 0 ? date.subtract(Math.abs(count), "hour") : date.add(count, "hour"); | ||
}; | ||
DayjsUtils.prototype.addDays = function (date, count) { | ||
return count < 0 ? date.subtract(Math.abs(count), "day") : date.add(count, "day"); | ||
}; | ||
DayjsUtils.prototype.addWeeks = function (date, count) { | ||
return count < 0 ? date.subtract(Math.abs(count), "week") : date.add(count, "week"); | ||
}; | ||
DayjsUtils.prototype.addMonths = function (date, count) { | ||
@@ -157,0 +173,0 @@ return count < 0 ? date.subtract(Math.abs(count), "month") : date.add(count, "month"); |
{ | ||
"name": "@date-io/dayjs", | ||
"version": "2.10.0", | ||
"version": "2.10.1", | ||
"description": "Abstraction over common javascript date management libraries", | ||
@@ -12,3 +12,3 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@date-io/core": "^2.10.0" | ||
"@date-io/core": "^2.10.1" | ||
}, | ||
@@ -45,3 +45,3 @@ "devDependencies": { | ||
"license": "MIT", | ||
"gitHead": "3b596e88e257510621c56883233ebc7676161e9f" | ||
"gitHead": "2ae1fe887c558bfb958fc74986a3da061aa15b40" | ||
} |
37828
955
Updated@date-io/core@^2.10.1