const list = [
{
T: 'TTTT',
Time: "2020-04-01 13:39:06"
},
{
T: 'vvvv',
Time: "2020-04-21 13:39:06"
},
{
T: 'ggggg',
Time: "2020-04-20 13:39:06"
},
{
T: 'fffff',
Time: "2020-04-20 15:39:06"
}
]
list.sort(function(a, b) {
return b.Time < a.Time ? -1 : 1
})
console.log(list)
JavaScript对数据按时间排序
最新推荐文章于 2024-10-06 23:08:36 发布