@alheimsins/dager-fra-dato
Version:
Returns days between two dates
28 lines (17 loc) • 743 B
Markdown
[](https://github.com/feross/standard)
Returns days between two dates.
```JavaScript
import { daysBetweenDates } from '@alheimsins/uker-fra-dato'
const start = new Date('2021-05-30')
const endOne = new Date('2021-05-31')
const endPast = new Date('2021-05-29')
console.log(daysBetweenDates(start)) //=> 0
console.log(daysBetweenDates(start, endOne)) // => 1
console.log(daysBetweenDates(start, endPast)) // => -1
```
[](LICENSE)
Created with ❤ for [Alheimsins](https://alheimsins.net)
<img src="https://image.ibb.co/dPH08G/logo_black.png" alt="Alheimsins logo" height="150px" width="150px" />