Date field is sorted like text and not date in backend

Hi !
I have a date field named “checkin_date” set up like this :

{
“weekstart”: 1,
“format”: “DD-MM-YYYY” /* Europe format */
}
I use this field to sort bookings by their arrival
Unfortunately, when I want to sort my entries in the backend, it’s not sorted like date but more like text.

Sorted desc give me this :

30-04-2021
21-05-2021
14-05-2021
07-05-2021

But I need the dates to be sorted chronologically like this :

30-04-2021
07-05-2021
14-05-2021
21-05-2021

Is there a way to achieve this with the field options ? Did I missed something ?
Since it’s a date field I thought it would have been sorted like dates.
I’ve looked everywhere, did not found anything about it.

Thanks !

1 Like

I’ve got pretty much the same problem… even changing the format to “YYYY-MM-DD” won’t change anything, because it doesn’t affect the already saved entries.

cockpit has no dedicated sorting for dates - you have to use the format YYYY-MM-DD or process/re-order the dates your self (which is quite easy with php / js but of course needs some extre performance instead of directly getting data in the right order)