durations =
[{name: "test1", time: "2019-07-11T10:25:22.000036-07:00"},
{name: "test2", time: "2019-07-11T10:27:22.000036-07:00"},
{name: "test3", time: "2019-07-11T10:20:22.000036-07:00"}]
如何按时间排序此数组中的对象。我已经尝试了无数次以进行排序,但是我尝试的所有方法均无效。这是我最近使用lodash的尝试。还尝试遵循此处Sort array by a date property
发布的解决方案orderedDurations: function () {
return _.orderBy(durations, moment('time'))