我正在使用Jquery DataTables在我的 ASP.NET MVC 项目之一中。我的列表页面包含日期时间列,例如 CreateOn、LastUpdatedOn 等。
我想对这些 DateTime 列启用排序,但问题是 DisplayFormat 和我要排序的数据不同。
意味着我想通过保留 DateTime 列的时间部分来对数据进行排序,但我不想显示时间部分。
我使用了Ultimate DateTime Sorting Plugin但我无法找出该插件中的选项。
有人可以帮我吗?
最佳答案
Jquery数据表使用td
中的data-order
属性来排序。要订购日期时间列,请使用我已经使用过并且对我来说效果很好的技术
convert your date in seconds then put that in data-order
查看图片以获取更多说明
关于javascript - jquery数据表日期时间列排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33229896/