Sort date DD/MM/YYYY hh:mm
Sort date DD/MM/YYYY hh:mm

Link to test case:
https://live.datatables.net/xuruheto/1/edit?html,js,output
Hi, I'm trying to sort my table using the Datatable datetime but it doesn't work at all for a date like "31/03/2025 10:25".
I reproduced it in the test case above, what am I missing ?
Thanks,
Alexis
This question has an accepted answers - jump to answer
Answers
Hi Alexis,
If you run your example it gives the
alert
:Going to the url given notes that if you use anything other than ISO8601 formatting you need to use Moment or Luxon.
Your example was also failing because
31/04/2011 01:09
is not a valid date. April only has 30 days.Fixing both issues addresses the problem: https://live.datatables.net/xuruheto/2/edit .
Allan
Perfect, thank you !
I also wanted to sort 2 dates format, and saw that I can just add another line DataTable.datetime('XXX');