Correctif sur le tri de l'affichage des sauts
This commit is contained in:
@@ -49,7 +49,13 @@ export class ListOfJumpsComponent implements OnInit {
|
|||||||
this.listOfJumps = this.serviceApi.GetListOfJumps();
|
this.listOfJumps = this.serviceApi.GetListOfJumps();
|
||||||
this.listOfJumps.subscribe(data => {
|
this.listOfJumps.subscribe(data => {
|
||||||
setTimeout(() => {
|
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 = new MatTableDataSource<JumpResp>(data);
|
||||||
this.dataSourceTable.paginator = this.paginator;
|
this.dataSourceTable.paginator = this.paginator;
|
||||||
this.resultsLength = data.length;
|
this.resultsLength = data.length;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<input type="text" matInput [matAutocomplete]="autoGear" [(ngModel)]="selectedGear" name="selectedGear">
|
<input type="text" matInput [matAutocomplete]="autoGear" [(ngModel)]="selectedGear" name="selectedGear">
|
||||||
<mat-autocomplete #autoGear="matAutocomplete" [displayWith]="displayFn">
|
<mat-autocomplete #autoGear="matAutocomplete" [displayWith]="displayFn">
|
||||||
<mat-option *ngFor="let gear of listOfGear" [value]="gear">
|
<mat-option *ngFor="let gear of listOfGear" [value]="gear">
|
||||||
{{gear.name}}
|
{{gear.name}} ({{gear.mainCanopy}})
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
<button mat-button *ngIf="selectedGear" matSuffix mat-icon-button aria-label="Clear"
|
<button mat-button *ngIf="selectedGear" matSuffix mat-icon-button aria-label="Clear"
|
||||||
|
|||||||
Reference in New Issue
Block a user