isEqual
Returns a boolean, false
if the first date is after the second date.
Usage
import { isEqual } from 'easy-dates'
isEqual(date, dateToCompare)
Prop types
prop | type | required | default |
---|---|---|---|
date | date | yes | n/a |
dateToCompare | date | yes | n/a |
Examples
isEqual(new Date('2022-01-01'), new Date('2022-01-01')) // true
isEqual(new Date(Date.now()), new Date(Date.now())) // true
isEqual(new Date('2022-01-01'), new Date('2022-01-02')) // false
isEqual(new Date('2022-01-01')) // false
isEqual('2022-01-02') // false