0
我有一些数据,我正在使用角度和数据表显示。现在我希望这些数据按日期排序。我的代码看起来像这样。排序和格式化日期角
<table dataTable="ng"
class="table table-striped table-bordered hover"
dt-options="dtOptions">
<thead>
<tr >
<th>Date/Time</th>
<th>Created By</th>
...
</tr>
</thead>
<tbody>
<tr ng-repeat="x in items | orderBy : 'timestamp' : true">
<td>{{x.timestamp | date: 'medium'}}</td>
<td>{{x.user.firstname}} {{x.user.lastname}}</td>
...
</tr>
</tbody>
</table>
但是,似乎我只能格式化日期或排序它,但不是两个在一起。如果我删除它的排序格式,否则它不会。
任何人都知道我在做什么错了?
看来这个问题是我的时间戳的格式。它是一个日期类型。它从c#DatetimeOffset中序列化。也许这是问题,因为它不会正确排序。 –
时间戳的格式如下:timestamp:“2015-09-11T00:00:00 + 10:00” –