这是我的样本数据:
{
"day": "Sunday",
"count": [{
"desc": "sunday one event"
}, {
"j": [{
"start": "11:00 pm"
}, {
"end": "11:51 pm"
}]
}, {
"desc": "sunday second event"
}, {
"j": [{
"start": "12:00 am"
}, {
"end": "12:06 am"
}]
}]
}
然后输出将是:
sunday one event
11:00 PM, 11:51 PM,
sunday second event
12:00 AM, 12:06 AM,
但我想将数据显示为:
sunday second event
12:00 AM, 12:06 AM,
sunday one event
11:00 PM, 11:51 PM,
如何根据时间(起始端)对数据进行排序
答案 0 :(得分:0)
我认为你应该在每一行都有一个id,然后这行代码将按顺序排序。
&#34; <tr ng-repeat="obj in object | orderBy:propertyName:reverse">
&#34;
答案 1 :(得分:-1)
最好的方法是存储Date对象并比较这些对象的getTime()以按日期排序。