Are the given dates equal?
Are the given dates equal?
// CommonJS
var isEqual = require('date-fns/isEqual')
// ES 2015 import isEqual from 'date-fns/isEqual'
// ESM
import { isEqual } from 'date-fns'
isEqual(dateLeft, dateRight)
| Name | Description |
|---|---|
dateLeft |
the first date to compare |
dateRight |
the second date to compare |
| Description |
|---|
|
the dates are equal |
| Type | Description |
|---|---|
TypeError |
2 arguments required |
// Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal? const result = isEqual( new Date(2014, 6, 2, 6, 30, 45, 0), new Date(2014, 6, 2, 6, 30, 45, 500) ) //=> false
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isEqual