Sorting date in datatable

后端 未结 5 1603
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 17:50

I\'m trying to sort dates in my datatable like DD/MM/YYYY (day, month, year) . I was following https://datatables.net/plug-ins/sorting/ .

but all the

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 18:18

    Use date-eu sorting plugin to sort dates in the format DD/MM/YY.

    Include the following JS file //cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js and use the code below:

    var historiektable = $('#dataTableHistoriek').DataTable({
        "paging" : false,
        "ordering" : true,
        "scrollCollapse" : true,
        "searching" : false,
        "columnDefs" : [{"targets":3, "type":"date-eu"}],
        "bInfo": true
    });
    

提交回复
热议问题