The Wayback Machine - https://web.archive.org/web/20201208045256/https://github.com/appbaseio/reactivesearch/issues/1526
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isEqual does not properly check date objects #1526

Open
mitchgillin opened this issue Aug 10, 2020 · 0 comments
Open

isEqual does not properly check date objects #1526

mitchgillin opened this issue Aug 10, 2020 · 0 comments
Labels
bug

Comments

@mitchgillin
Copy link

@mitchgillin mitchgillin commented Aug 10, 2020

Affected Projects
React

Library Version: x.y.z
9.6.15

Describe the bug
In the date range component, the isEqual function is passed an object with an object as the value in the key value pair
const d1 = new Date("1-15-2020);
const d2 = newDate("2-15-2020);
const d3 = new Date("3-15-2020);
isEqual({start: d1, end: d2}, {start:d1, end:d3} === true

To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/s/stoic-bush-jsrrt?file=/src/App.js:164-184
Use a date range as a controlled component; the on change methods will not fire because it is detecting the values are equal.

Expected behavior
Clicking the button in the sandbox above should set the date properly; this can be fixed by adding a JSON.stringify check to the isEqual function

Screenshots

Desktop (please complete the following information):

  • OS: MacOS 10.15.6
  • Browser: Brave
  • Version: 1.13.59

Additional context

@mitchgillin mitchgillin added the bug label Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.