Hi,
thanks for your question, and sorry for the trouble.
You should not need that Extension here, so that I suggest to remove it again. Instead, please try this “Custom Command”:
"columnDefs": [ { "type": "date", "targets": [ 0 ] } ]
Regards,
Tobias
Thank you, that was what i needed. I could not find the solution you gave me in the documentation. Is it in there and did I just miss it?
Hi,
Good to hear that this helped!
This is not in the TablePress documentation but in the DataTables documentation at https://www.datatables.net/
Usually, this is not necessary as DataTables can auto-detect formats, but for some reason that failed here, which is why the “Custom Command” is necessary.
Regards,
Tobias
Hi Tobias,
I have a similar problem with german date formats. We tried this line of command “columnDefs”: [ { “type”: “formatted-num”, “targets”: [ 1 ] } ] but it doesn’t work. Any idea?
https://albionacademy.de/tabellen-test/
Thanks in advance.
Best,
Thorsten
Hi Thorsten,
for you, it should actually be sufficient to force DataTables to use German as its language. This will work by setting the site’s language to German, or by adding a parameter to the Shortcode:
[table id=23 datatables_locale="de_DE" /]
You should then not need that “Custom Command”.
Regards,
Tobias
Hi Tobi,
thank you for your help. The locale did the trick :).
Best,
Thorsten
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!
Hi Tobi,
it’s me again. My client set up a new table with this shortcode [table id=testtable datatables_locale=”de_DE” /] but the date is not sorting correctly. Any ideas?
https://albionacademy.de/testtable/
Best,
Thorsten
Hi Thorsten,
that’s strange… Please try forcing the date format by adding this to the “Custom Commands” (“Eigene Befehle”) text field on the table’s “Edit” screen:
"columnDefs": [ { "type": "date", "targets": [ 2 ] } ]
Regards,
Tobias
Hi Tobi,
that sutom command didn’t work. Still confused why that happens? Sorry for not getting back earlier. Missed the email notification.
Best,
Thorsten
Hi Thorsten,
ok, you might then need the TablePress Extension from https://tablepress.org/extensions/datatables-sorting-plugins/
After installing that, please also modify the “Custom Command” to
"columnDefs": [ { "type": "date-eu", "targets": [ 2 ] } ]
Regards,
Tobias
Hi Tobi,
thanks for your quick response. It does work now.
Thanks,
Thorsten
Hi,
great! Thanks for the confirmation!
Best wishes,
Tobias