Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
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. Also I came across this old issue (#3973) and got to know that dates by default/ISO format are saved as Date objects and dates with custom format are saved as strings. Keeping these things in mind, how do you want me to go about implementing the fix? Please correct me if I'm wrong in my understanding. |
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 |
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: