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

Fix date sorting #160

Merged
merged 1 commit into from
Sep 14, 2018
Merged

Fix date sorting #160

merged 1 commit into from
Sep 14, 2018

Conversation

sabas
Copy link
Contributor

@sabas sabas commented Jul 26, 2018

The search allowed for years using 2 or 4 digits, while the sorting considered only 2. The reformatting is in ISO format.

The search allowed for years using 2 or 4 digits, while the sorting considered only 2. The reformatting is in ISO format.
@tristen
Copy link
Owner

tristen commented Jul 26, 2018

The change to support 4 digit years sounds good I'm not sure this PR should adjust the formatting in parseData as well though. What scenario were you running into where this failed as is?

@sabas
Copy link
Contributor Author

sabas commented Jul 27, 2018

I have a table dumped from a MSSQL query where the dates are formatted as 27/07/2018
When I order the data I saw that they weren't ordered correctly, firstly because of the regex, but also I think due to new Date() not understanding the date only in dd/mm/yyyy format. Reformatting as an ISO date (yyyy-mm-dd) allows the correct order. I tried on chrome and internet explorer.

@tristen
Copy link
Owner

tristen commented Sep 14, 2018

👍

@tristen tristen merged commit f4bc7d7 into tristen:gh-pages Sep 14, 2018
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

Successfully merging this pull request may close these issues.

2 participants