@alheimsins/dager-fra-dato
v1.0.1
Published
Returns days between two dates
Downloads
8
Readme
dager-fra-dato
Returns days between two dates.
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
About
Created with ❤ for Alheimsins