Skip to content

Sorting with custom date format seems wrong #4637

@pmpinto

Description

@pmpinto

Describe the bug
I have a release-date field with a custom date_format set to DD-MM-YYYY, so something like:

name: 'release-date'
label: 'Release date'
widget: 'datetime'
date_format: 'DD-MM-YYYY'
format: 'DD-MM-YYYY'

Then I have release-date set under sortable_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
Screenshot 2020-11-26 at 17 10 22

Applicable Versions:

  • Netlify CMS version: 2.10.71
  • Git provider: GitHub
  • OS: macOS 11.0.1
  • Browser version: Brave v1.16.76
  • Node.JS version: 12.17.0

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions