@date-io/dayjs
Advanced tools
Comparing version 2.9.2 to 2.10.0
{ | ||
"name": "@date-io/dayjs", | ||
"version": "2.9.2", | ||
"version": "2.10.0", | ||
"description": "Abstraction over common javascript date management libraries", | ||
@@ -12,3 +12,3 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@date-io/core": "^2.9.2" | ||
"@date-io/core": "^2.10.0" | ||
}, | ||
@@ -45,3 +45,3 @@ "devDependencies": { | ||
"license": "MIT", | ||
"gitHead": "4712b8927e09e6bb5378436783e15d48e174584d" | ||
"gitHead": "3b596e88e257510621c56883233ebc7676161e9f" | ||
} |
@@ -184,2 +184,18 @@ import defaultDayjs, { QUnitType } from "dayjs"; | ||
public addSeconds(date: Dayjs, count: number) { | ||
return count < 0 | ||
? date.subtract(Math.abs(count), "second") | ||
: date.add(count, "second"); | ||
} | ||
public addMinutes(date: Dayjs, count: number) { | ||
return count < 0 | ||
? date.subtract(Math.abs(count), "minute") | ||
: date.add(count, "minute"); | ||
} | ||
public addHours(date: Dayjs, count: number) { | ||
return count < 0 ? date.subtract(Math.abs(count), "hour") : date.add(count, "hour"); | ||
} | ||
public addDays(date: Dayjs, count: number) { | ||
@@ -189,2 +205,6 @@ return count < 0 ? date.subtract(Math.abs(count), "day") : date.add(count, "day"); | ||
public addWeeks(date: Dayjs, count: number) { | ||
return count < 0 ? date.subtract(Math.abs(count), "week") : date.add(count, "week"); | ||
} | ||
public addMonths(date: Dayjs, count: number) { | ||
@@ -191,0 +211,0 @@ return count < 0 ? date.subtract(Math.abs(count), "month") : date.add(count, "month"); |
36168
919
Updated@date-io/core@^2.10.0