diff --git a/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.ts b/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.ts index 43125af..df674b7 100644 --- a/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.ts +++ b/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.ts @@ -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(data); this.dataSourceTable.paginator = this.paginator; this.resultsLength = data.length; diff --git a/Front/skydivelogs-app/src/app/new-jump/new-jump.component.html b/Front/skydivelogs-app/src/app/new-jump/new-jump.component.html index cc9ca06..a9c06ad 100644 --- a/Front/skydivelogs-app/src/app/new-jump/new-jump.component.html +++ b/Front/skydivelogs-app/src/app/new-jump/new-jump.component.html @@ -56,7 +56,7 @@ - {{gear.name}} + {{gear.name}} ({{gear.mainCanopy}})