-
Notifications
You must be signed in to change notification settings - Fork 178
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
Date Parsing not working correctly #175
Comments
Hey man. Great library overall. Can you please test these dates on your system you will see the problem. format: dd.mm.yyyy The sorting completely stops / produces incorrect results. Just try it with a few dates you'll see straight away. But for all that I can think of using a string comparison or even numeric comparison on (YYYYMMDD) should give the correct result. FYI the code i've provided is targetting 2 digit year format so the code would need to be updated to work with both 2 digit & 4 digit. ALTERNATIVELY, I would be interested if you could suggest why the original date parse method wasn't working with dot separator (even though I added dot handling into your code) |
i used the "data-sort" attribut as workaround. Example: i used a few days later it paid off, because I used a different formatting |
That's a good idea. Declaring a manual sort is good for fields which have no internal logic based on their value but you want to sort on them using an implied or relational logic. If possible it's better to avoid it. |
I suggest changing date parse to this modified version below.
I have tested this and it works every time in my testing.
Just test the date as a numeric string
The text was updated successfully, but these errors were encountered: