Adding get-days-difference-between-dates

This commit is contained in:
Leandro Franciscato
2017-12-14 10:36:36 -02:00
parent 54dc5e9e39
commit c54c4db018
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,8 @@
### Get Days Difference Between Dates
Returns the number of days between two Dates.
```js
const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24);
//getDaysDiffBetweenDates(new Date("2017-12-13"), new Date("2017-12-22")) -> 9
```