Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Incorrect result of deepEqual for dates #7

Open
skisor opened this issue Jul 15, 2016 · 2 comments
Open

Incorrect result of deepEqual for dates #7

skisor opened this issue Jul 15, 2016 · 2 comments
Assignees

Comments

@skisor
Copy link

skisor commented Jul 15, 2016

Try

is.deepEqual(new Date("2012-12-12T00:30:00.000Z"), new Date("2021-11-11T13:12:00.000Z"))

Expected

false because dates are different (timestamps are 1355272200000 and 1636636320000)

Actual

true

"is" version: 1.0.2
node: 6.2.0

@mov37
Copy link
Owner

mov37 commented Jul 21, 2016

Hi @skisor , the current version of deepEqual only counts for Arrays and generic Objects, so two Date objects are considered equal if they have the same set of own, enumerable and string-keyed properties. This will be fixed in the next version.

@mov37 mov37 self-assigned this Jul 21, 2016
@ghost
Copy link

ghost commented Oct 7, 2016

This bug have been unsolved for very long time? Maybe this repo could give a few ideas? https://github.com/zubuzon/kewlr

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants