Hi,
thanks for your post, and sorry for the trouble.
This Shortcode parameter from the Row Order Extension shows the table in reversed order from that on the “Edit” screen. It does not do any sorting. (Sorting is possible with other parameters, but not directly for dates, due to the various possible formats.)
I would therefore indeed recommend a JS-based sorting, via a “Custom Command”. To find that, can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
Regards,
Tobias
Sorry for the late reply.
Okay great, here is my link.
https://livinghisword.org/daily-biblical-news/
Hi,
thanks for the link!
To automatically sort by these dates, please add this to the “Custom Commands” text field:
"order": [ [ 5, "desc" ] ]
This will sort by the sixth column (counting the columns starts with 0), in descending order. To get ascending order, use "asc" in the code.
Regards,
Tobias
Thank you for this code, however it is still not sorting correctly. The next date, after 3-23-22, should be 11-5-2021 and then 11-3-2021 and so forth.
Am I doing something wrong?
Thank you
https://livinghisword.org/daily-biblical-news/
Hi,
ok, it looks like the format auto detection is not working properly. We might just have to manually set the data type to “date” for that column. To achieve that, please change the full “Custom Command” to
"columnDefs": [ { "className": "none", "targets": [ 1, 2, 3, 4 ] }, { "type": "date", "targets": [ 5 ] } ], "order": [ [ 5, "asc" ] ]
Regards,
Tobias
Whoohoo, it finally works. Thank you sooooooooo much!!!!!!!!
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias