I have ionic 2 app and old version of angularjs, so it have no orderby pipe by default.. so I have array like this
<div *ngFor="let boatBooking of boatBookings" style="padding: 0px; margin:0px;">
<ion-item>
<ion-icon *ngIf="boatBooking.status !== 3" name="boat" item-left></ion-icon>
<h3 *ngIf="boatBooking.status !== 3">{{ boatBooking.boat.name }}</h3>
<p *ngIf="boatBooking.status !== 3"><small><strong>{{ boatBooking.date | date: 'dd/MM/y' }}</strong></small></p>
<ion-icon *ngIf="boatBooking.status === 3" style="color:#d0d0d0!important" name="boat" item-left></ion-icon>
<h3 *ngIf="boatBooking.status === 3" style="color:#d0d0d0!important">{{ boatBooking.boat.name }}</h3>
<p *ngIf="boatBooking.status === 3" style="color:#d0d0d0!important"><small><strong>{{ boatBooking.date | date: 'dd/MM/y' }}</strong></small></p>
<ion-note *ngIf="boatBooking.status !== 3" item-end><div style="background:#f53d3d;" class="ppoints">-{{ boatBooking.boat.pointsPerDay }} </div></ion-note>
<ion-note *ngIf="boatBooking.status === 3" item-end><div style="background:#ddd4d4; color:#848484" class="ppoints">0</div></ion-note>
</ion-item>
</div>
getting data from firebase with angularfire 2 version (I know all code is old but can not update at this moment)
I have timestamp of boatBooking:
boatBooking.timestamp and want to oreder array width custom pipe or width somethins, searched in google but not found any pipe like this.
so my question is: how to order array width pipe using boatBooking.timestamp? (timestamp is in milisecondss)
here is array code
this.boatService.getUserBookings(this.member['$key']).subscribe(boatBookings => {
this.boatBookings = [];
boatBookings.forEach(boatBooking => {
this.boat = this.boatService.getBoat(boatBooking.boatId);
this.boatService.getBoat(boatBooking.boatId).first().subscribe(boat => {
this.boatBookings.unshift(Object.assign(boatBooking, { boat }));
});
});
});