Hi,
thanks for your post, and sorry for the trouble.
The problem here are cells like “not recorded” and similar. Due to these, the sorting algorithm switches to string instead of date sorting.
If you can’t replace these cells with a date, I recommend using the approach described at https://ww.wp.xz.cn/support/topic/tablepress-sorting-dates/#post-9471448
You would basically have to add a second but hidden column for the dates, where these entries would get a fake date.
Regards,
Tobias
Thread Starter
tneorg
(@tneorg)
Thanks. I’ve removed the text from the columns, but that hasn’t worked yet. Is it possible that all cells must have data in order to work?
Thanks!
Hi,
empty cells shouldn’t matter, from what I remember. However, the cell “0/0/1987” might also be a reason.
You could also try forcing date sorting, but adding this to the “Custom Commands” textfield on the “Edit” screen of the table:
"columnDefs": [ { "type": "date", "targets": [ 10 ] } ]
Regards,
Tobias
Thread Starter
tneorg
(@tneorg)
It was not the 0/0/1987 – It was simply adding the code you gave me above! Although the 0/0 did not sort at all, so I gave it a 1/1 and it is now in the list. Thanks yet again!
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!