Correctif sur le tri de l'affichage des sauts

This commit is contained in:
Sébastien André
2021-05-01 09:49:28 +02:00
parent 44ad369e75
commit dcdd3c353c
2 changed files with 8 additions and 2 deletions

View File

@@ -49,7 +49,13 @@ export class ListOfJumpsComponent implements OnInit {
this.listOfJumps = this.serviceApi.GetListOfJumps();
this.listOfJumps.subscribe(data => {
setTimeout(() => {
data.sort((a, b) => b.id - a.id);
data.sort((a, b) => {
if (a.jumpDate.getTime() === b.jumpDate.getTime()) {
return b.id > a.id ? 1 : -1;
}
return b.jumpDate > a.jumpDate ? 1 : -1;
});
this.dataSourceTable = new MatTableDataSource<JumpResp>(data);
this.dataSourceTable.paginator = this.paginator;
this.resultsLength = data.length;

View File

@@ -56,7 +56,7 @@
<input type="text" matInput [matAutocomplete]="autoGear" [(ngModel)]="selectedGear" name="selectedGear">
<mat-autocomplete #autoGear="matAutocomplete" [displayWith]="displayFn">
<mat-option *ngFor="let gear of listOfGear" [value]="gear">
{{gear.name}}
{{gear.name}} ({{gear.mainCanopy}})
</mat-option>
</mat-autocomplete>
<button mat-button *ngIf="selectedGear" matSuffix mat-icon-button aria-label="Clear"