Date sorting problem with jQuery Tablesorter

前端 未结 7 1391
孤街浪徒
孤街浪徒 2020-11-29 03:21

I am trying to sort a table which has column like 2009-12-17 23:59:59.0. I am using below to apply sort

$(document).ready(function() { 
    $(\         


        
7条回答
  •  北海茫月
    2020-11-29 03:31

    With the latest version 2.18.4 you can simply do like this.Just give the default date format and in the particular column set the column date format this will work ONLY with 'shortDate' sorter.

    $('YourTable').tablesorter(
                {
                    dateFormat:'mmddYYYY',
                    headers: {
                        0: { sorter: false },
                        1: { sorter: true},
                        2: { sorter: true },
                        3: { sorter: true },
                        4: { sorter: "shortDate", dateFormat: "ddmmyyyy" },
                        5: { sorter: true },
                        6: { sorter: false },
                        7: { sorter: false },
                        8: { sorter: false },
                        9: { sorter: false },
                        10: { sorter: false },
                        11: { sorter: false }
    
                    }
                });
    

提交回复
热议问题