How to sort datatables with date in descending order

前端 未结 14 1953
我寻月下人不归
我寻月下人不归 2020-12-29 11:11

I wish to show the records using datatables with default ordering based on one of my rows with date & time in descending order. Please help me in editing the jquery stru

14条回答
  •  离开以前
    2020-12-29 11:46

    The simpliest way is to add a hidden timestamp before the date in every TD tag of the column, for example:

    
        154702261509/01/2019  09:30
    
    

    With the default string ordering, a timestamp would order the column the way you want and it will not be shown when rendered in the browser.

提交回复
热议问题