按日期排序数组中的数组

时间:2018-01-24 16:08:13

标签: javascript jquery arrays sorting

如果我有这样的数组,如何按日期对数组中的数组进行排序:

现在数组:

[{place: "TEST", date: "2018-01-25 17:25", quantity: "12"}, {place: "TEST2", date: "2018-01-24 17:25", quantity: "2"}]

排序数组

[{place: "TEST2", date: "2018-01-24 17:25", quantity: "2"}, {place: "TEST", date: "2018-01-25 17:25", quantity: "12"}]

0 个答案:

没有答案