我需要使用Angular js从日期时间(例如:2013-09-03 05:02:04)中提取小时和分钟。我已经这样做了。
JSON数据:
{
"status": "success",
"data": [
{
"PriorityPassReservation": {
"site_id": "8",
"id": "235907",
"priority_pass_schedule_id": "4",
"member_id": null,
"member_guid": "8-853414",
"reservation_dt": "2013-09-05 19:00:00",
"checkin_dt": null,
"reminder_sent": "0",
"created": "2013-09-03 05:02:04",
"modified": "2013-09-03 05:02:04",
"status": "booked"
}
]
}
HTML:
<tr ng-repeat="priority in priorityDetails.data">
<td class="no">{{ $index +1 }}</td>
<td class="priority_time">{{priority.PriorityPassReservation.reservation_dt| date:' hh:mm'}}</td>
</tr>
但它没有给出实际结果。有人知道解决方案吗?
注意:priority.PriorityPassReservation.reservation_dt
是一个 json 字符串