0

I have Dates in this format ranging from May 9, 2013 9:05:24 PM to May 15, 2013 9:05:24 PM

Where the sort order is descending or the arrow is pointing down and the sorting comes out like

May 9, 2013 9:05:24 PM
May 15, 2013 9:05:24 PM
May 14, 2013 9:05:24 PM
May 13, 2013 9:05:24 PM
May 10, 2013 9:05:24 PM

and when I hit the column to sort it the other direction the sort looks like

May 10, 2013 9:05:24 PM
May 13, 2013 9:05:24 PM
May 14, 2013 9:05:24 PM
May 15, 2013 9:05:24 PM
May 9, 2013 9:05:24 PM

My datatable code looks like.

   var oTable = $('#status_table').dataTable({
        "sPaginationType": "full_numbers",
        "bPaginate": true,
        "bFilter": false,
        "bAutoWidth": true,
         "sScrollY": "300px",
        "bScrollCollapse": true,
        "oLanguage": {
            "sInfo": 'Showing _END_ Messages.',
            "sEmptyTable": "No Messages to display currently.",
            "sInfoEmpty": "No Messages to display."
        },
        "aaSorting": [[ 7, "desc" ]],
        "aoColumns": [
              { "bSortable": false,  "sWidth":"5%"},
              { "bVisible": false },//code
              { "bSortable": false, "sWidth":"5%"},
              { "bVisible": false },//code
              { "bSortable": false, "sWidth":"15%" },
              { "bVisible": false },//code
              { "bSortable": false, "sWidth":"50%"},
              { "sWidth":"25%" }
           ]
    });
    return oTable;

does anyone know what the issue is/could be? and how to possible solve it?

4

1 回答 1

1

数据的排序就像它是一个字符串,而不是一个日期。看看这个问题:

如何使用 DataTables jquery 插件按日期排序?

于 2013-05-16T22:58:22.157 回答