-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Sorting with custom date format seems wrong #4637
Comments
@pmpinto @erezrokah I would like to work on this issue. |
Thanks @BA1RY, I've assigned you to the issue |
@erezrokah I looked into it and noticed that below code snippet is where sorting happens and any changes have to be made there. |
Great research @BA1RY. I think that for sorting we would need to add a special case for dates. |
@erezrokah Understood. It makes sense. As you said the bug must be due to dates getting sorted as strings. |
I think the only way to know for sure is based on the |
So how can I get to know widget type and format in the below method? I tried it and wasn't successful at it. |
I'll need to dig into it a bit more, I think we would need to save additional information for the sort fields |
So is what I'm seeing that the current workaround would be for me to convert all my dates to YYYY-MM-DD so that sorting as a string works as expected? I currently have everything as MM/DD/YYYY, but I could run a regex replace on my date fields if that will solve my sorting problem. |
Describe the bug
I have a
release-date
field with a customdate_format
set toDD-MM-YYYY
, so something like:Then I have
release-date
set undersortable_fields
, which gets recognized, but doesn't quite work as expected.Expected behavior
I would expect the items to be listed considering the
date_format
and sorted by year first, then month, then day. Not the opposite as it seems to be happening.Screenshots
Applicable Versions:
The text was updated successfully, but these errors were encountered: