与/日(############)格式AngularJS日期过滤器 [英] AngularJS Date Filter with /Date(############) format
问题描述
我有一个JSON对象,我可以加载并使用AngularJS解析。
名字和其他领域都如预期显示。
I have a json object which I can load and parse using AngularJS. The FirstName and other fields are display as expected.
我需要显示DateLogin这是JSON显示为/日期(1306745196000)/
I need to display the DateLogin which is json shows as "/Date(1306745196000)/"
在下面的例子: http://docs.angularjs.org/api/ng。过滤:日期
在我的code我有
<small>login: {{mem.DateEntered | date:'medium'}}</small>
这是呈现为
login: /Date(1306745196000)/
有望
login: May 30, 2011 1:46:36 AM
我如何我用AngularJS日期过滤器来显示日期友善与具有JSON /日期(##########)?
How do I I use AngularJS date filter to show a friendly date with json having /Date(##########)?
推荐答案
创建其转换为JavaScript日期对象,然后返回筛选结果的自定义过滤器。
Create a custom filter that converts it to a javascript date object and then returns the filtered result.
请参阅:转换JSON结果的日期
,然后只用过滤得到的对象上。
And then just use the filter on the resulting object.
这篇关于与/日(############)格式AngularJS日期过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!