我正在使用AngularJS构建html应用程序,其中我想在html页面上显示json文件数据。谁能帮我从JSON文件转换GMT日期格式小时:分钟AM/PM将GMT日期格式转换为时间格式
JSON文件看起来是这样的:
[
{
"startTime": "Sun May 24 2015 01:00:00 GMT+0530 (IST)",
"endTime": "Sun May 24 2015 01:30:00 GMT+0530 (IST)",
"title": "Event 1"
},
{
"startTime": "Sun May 24 2015 04:00:00 GMT+0530 (IST)",
"endTime": "Sun May 24 2015 06:00:00 GMT+0530 (IST)",
"title": "Event 2"
},
{
"startTime": "Sat May 23 2015 20:00:00 GMT+0530 (IST)",
"endTime": "Sat May 23 2015 21:30:00 GMT+0530 (IST)",
"title": "Event 3"
},
{
"startTime": "Sat May 23 2015 21:30:00 GMT+0530 (IST)",
"endTime": "Sat May 23 2015 22:15:00 GMT+0530 (IST)",
"title": "Event 4"
},
{
"startTime": "Sun May 24 2015 02:00:00 GMT+0530 (IST)",
"endTime": "Sun May 24 2015 03:00:00 GMT+0530 (IST)",
"title": "Event 5"
}
]
用于显示上午/下午您可以使用过滤器,如{{data |日期:'h:m a'}}' –
是的,我错过了,谢谢 – worldask