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

"2019-12-30" and "12/30/2019" parsed as different dates #100

Open
dahjelle opened this issue Dec 22, 2020 · 2 comments
Open

"2019-12-30" and "12/30/2019" parsed as different dates #100

dahjelle opened this issue Dec 22, 2020 · 2 comments

Comments

@dahjelle
Copy link

I had an issue where "2019-12-30" and "12/30/2019" were not comparing as equal. While I recognize this is really an issue with JavaScript, it might make sense for a sort of work-around to be available in the library.

From Firefox:

image

@dahjelle
Copy link
Author

dahjelle commented Jan 5, 2021

@dahjelle
Copy link
Author

dahjelle commented Jan 8, 2021

It's a bit hacky, but I was able to solve this in parseDate by adding something like this:

if (/^\d{4}-\d{1,2}-\d{1,2}$/.test(value)) {
  parsedDate = Date.parse(value + "T00:00:00");
}

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

No branches or pull requests

1 participant