2017-05-26 40 views
0

我正在使用datatable在表中顯示結果。在數據表中排序自定義日期

enter image description here

當我點擊排序是按天排序日期,而忽略月份和年份。

上升 enter image description here

下降,我此刻正在使用的是

$('.dtbt2').DataTable({ 
    "ordering" : true, 
    "scrollCollapse" : true, 
    "columnDefs" : [{"targets":3, "type":"date-eu"}], 
    "bInfo": true 
}); 

我應該怎麼做才能正確地排序 enter image description here

碼?

感謝你很好的人提前, Auj

回答

0

的類型是:迄今爲止歐盟的開箱數據表的數據類型?我從來沒有用過它。但如果不是,請嘗試使用擴展功能,如this example或嘗試將類型更改爲日期。這應該適當排序。如果您需要其他類型日期完成的其他內容,則只需使用擴展選項來定義自己的自定義排序。