@date-io/moment
Advanced tools
Comparing version 2.9.2 to 2.10.0
{ | ||
"name": "@date-io/moment", | ||
"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" | ||
}, | ||
@@ -44,3 +44,3 @@ "devDependencies": { | ||
"license": "MIT", | ||
"gitHead": "4712b8927e09e6bb5378436783e15d48e174584d" | ||
"gitHead": "3b596e88e257510621c56883233ebc7676161e9f" | ||
} |
@@ -169,2 +169,20 @@ import defaultMoment, { LongDateFormatKey } from "moment"; | ||
public addSeconds(date: Moment, count: number) { | ||
return count < 0 | ||
? date.clone().subtract(Math.abs(count), "seconds") | ||
: date.clone().add(count, "seconds"); | ||
} | ||
public addMinutes(date: Moment, count: number) { | ||
return count < 0 | ||
? date.clone().subtract(Math.abs(count), "minutes") | ||
: date.clone().add(count, "minutes"); | ||
} | ||
public addHours(date: Moment, count: number) { | ||
return count < 0 | ||
? date.clone().subtract(Math.abs(count), "hours") | ||
: date.clone().add(count, "hours"); | ||
} | ||
public addDays(date: Moment, count: number) { | ||
@@ -176,2 +194,8 @@ return count < 0 | ||
public addWeeks(date: Moment, count: number) { | ||
return count < 0 | ||
? date.clone().subtract(Math.abs(count), "weeks") | ||
: date.clone().add(count, "weeks"); | ||
} | ||
public addMonths(date: Moment, count: number) { | ||
@@ -178,0 +202,0 @@ return count < 0 |
33579
878
Updated@date-io/core@^2.10.0