DataTable Date Sort

DataTable Date Sort

julius1973julius1973 Posts: 1Questions: 0Answers: 0
edited June 2012 in General
I have a column in my dataTable that displays a date in the format September 01, 2012. How can I get this to sort properly? if I set stype="date" it sorts months first then dates but ignores years.

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    That format isn't automatically picked up by the Javascript Date.parse() method - which DataTables uses to do the internal date sorting. As such, you will need to use a date sorting plug-in such as: http://datatables.net/plug-ins/sorting#date_eu (the plug-in will need to be slightly modified to match your specific formatting).

    Allan
This discussion has been closed.