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

Jekyll Collections not sorting by date #5198

Closed
shushugah opened this issue Apr 1, 2021 · 1 comment
Closed

Jekyll Collections not sorting by date #5198

shushugah opened this issue Apr 1, 2021 · 1 comment
Labels
area: ui/collection duplicate type: bug code to address defects in shipped code

Comments

@shushugah
Copy link

Describe the bug
In both the default and manually specified sortable_fields: ['fields.date'], the collection (events) is sorted by their file name and not their front matter date. This is the repository https://github.com/techworkersco/twc-site-berlin, and the admin-configs

Screenshot 2021-04-01 at 15 02 04

Screenshot 2021-04-01 at 15 09 39

In either situation, the files "sorted" by date, show collection of events 1.md, 10.md, 11.md, 2.md, 21.md etc..

Expected behavior
I'd expect that the date column is used to sort the files

@shushugah shushugah added the type: bug code to address defects in shipped code label Apr 1, 2021
@erezrokah
Copy link
Contributor

Hi @shushugah I believe this is a duplicate of #4637.

You should use ISO format for the dates in order for the sort to treat them as dates and not strings (until that issue is resolved).
See https://raw.githubusercontent.com/netlify/netlify-cms/master/website/content/blog/netlify-cms-2-4-0.md

Closing, please comment if you have additional questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui/collection duplicate type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants