【发布时间】:2019-02-24 14:27:24
【问题描述】:
我正在使用时刻库作为日期格式。我可以转换成控制器,但我不能转换成 HTML 页面。在 Json 中给了我长类型的日期。我想转换为当地时间。如下格式:
{{时刻(when.$date).format('YYYY-MM-DD@HH:mm')}}
JSON
{
"comments":
"when": {
"$date": 1536920319204
}
}
控制器:
$scope.responseData = response;
HTML
<table class="table table-bordered">
<thead>
<tr bolder>
<th class="bordered"> Date and Time </th>
<th class="bordered">Comments</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="myDetails in responseData ">
<td>
{{myDetails.when.$date}} //I want to convert into local time
</td>
<td>{{myDetails.comments}}</td>
</tr>
</tbody>
</table>
请提供想法如何使用 ng-repeat 转换为 html 页面。
【问题讨论】:
-
when.$date的值是多少??
标签: jquery angularjs html momentjs angular-moment