angular-filter
angular-filter copied to clipboard
groupBy : 'datetime'
Hi, I'm trying to groupBy a datetime but what happens is that all my datetime's are different and I get different groups by each minute.
How can I change the datetime when doing the ng-repeat ?
My code:
<ul class="timeline" ng-repeat="(key, value) in notifications | groupBy: 'datetime'">
<!-- timeline time label -->
<li class="time-label">
<span class="bg-blue">
{{key | date: 'MMM d, y'}}
</span>
</li>
<!-- /.timeline-label -->
<!-- timeline item -->
<li ng-repeat="notification in value">
<!-- timeline icon -->
<i class="ng-class: notification.cssClass ;"></i>
<div class="timeline-item">
<span class="time"><i class="fa fa-clock-o"></i> {{notification.datetime | date : 'HH:mm'}}</span>
<h3 class="timeline-header">
<a ng-href="{{notification.url}}">{{notification.title}}</a>
</h3>
<div class="timeline-body">
<p ng-bind-html="notification.message"></p>
</div>
</div>
</li>
<!-- END timeline item -->
</ul>
Thank you!