date-fns-duration
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "date-fns-duration", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Supplemental package for date-fns to add/subtract ISO 8601 durations", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mochista -t index.test.js", | ||
"test": "jest index.test.js", | ||
"cov": "npm t -- --coverage", | ||
"testw": "npm t -- --coverage --watch", | ||
"tsc": "tsc", | ||
"lint": "eslint" | ||
"lint": "eslint *.js" | ||
}, | ||
@@ -20,3 +20,3 @@ "repository": "pke/date-fns-duration", | ||
], | ||
"author": "Philipp Kursawe <phil.kursawe@gmail.com> (https://pke.fyi/)", | ||
"author": "Philipp Kursawe <pke@pke.fyi> (https://pke.fyi/)", | ||
"license": "MIT", | ||
@@ -30,7 +30,4 @@ "peerDependencies": { | ||
"eslint-plugin-mocha": "6.2.2", | ||
"mochista": "0.22.0" | ||
}, | ||
"dependencies": { | ||
"date-fns": "^2.0.1" | ||
"jest": "26.6.3" | ||
} | ||
} |
@@ -15,3 +15,13 @@ # data-fns-duration | ||
```js | ||
addDuration(date, duration) | ||
import addDuration from 'date-fns-duration'; | ||
// addDuration(date, duration); | ||
// Add duration | ||
const two_hours_from_now = addDuration(Date.now(), "PT2H"); | ||
// Subtract duration | ||
const month_before = addDuration("2018-10-02T10:00", "-P1M"); | ||
``` |
2223
1
27
+ Addeddate-fns@2.0.1(transitive)
- Removeddate-fns@^2.0.1
- Removed@babel/runtime@7.24.7(transitive)
- Removeddate-fns@2.30.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)