Ultimate date / time sorting plug... is not working.

Ultimate date / time sorting plug... is not working.

zotek94zotek94 Posts: 1Questions: 1Answers: 0

I want to format my dates from my database ('Y-m-d') to 'DD.MM.YYYY.' with datetime moment pluging but it's not working. I even installed everything locally and still nothing. I'm using server-side for my table, but even in browser it's not working.Here is an example of my code:
http://live.datatables.net/yuxajowu/98/edit?html,js,output

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736
    Answer ✓

    The $.fn.dataTable.moment( 'DD.MM.YYYY' ); statement is used to tell the sorting plugin the format of the datetime in the column. It doesn't actually convert the column to use that format. In order to make the conversion you will need to use the moment() function with columns.render for the column. For example:
    http://live.datatables.net/deyilima/1/edit

    Note that I changed one of your dates to 31.01.2016 to highlight that sorting is working.

    Kevin

This discussion has been closed.