我的模板中有以下开头标记:
<div class="t-th" title="{{row.created | date:'h:MMa'}}">
当row.created
为1436908657492
时(7/14/15 5:17 PM),已编译的代码为:
<div class="t-th ng-binding" title="5:07PM" ng-style="_stResize(5)" style="flex: 1 1 0px;">
ngStyle / style属性由其他地方的指令添加;我的问题是5:07不是时间戳的正确转换,5:17是。为什么Angular会在10分钟内完成转换?
答案 0 :(得分:1)
改变这个:
<div class="t-th" title="{{row.created | date:'h:MMa'}}">
到此:
<div class="t-th" title="{{row.created | date:'h:mma'}}">
“MM”代表一年中填充01-12个月(7月是一年中的第7个月,因此Angular可以正常工作)。 “mm”代表00-59填充的分钟。
答案 1 :(得分:0)
请尝试使用date:'h:mma'
。 MM
是月。