Tri des périodes d'essai par date de fin prévue + en gras

pull/22/head
Clement FERRERE 2 years ago
parent 1423298acc
commit 87f43200d3
  1. 2
      src/app/components/periode-essai/periode-essai.component.html
  2. 5
      src/app/components/periode-essai/periode-essai.component.ts

@ -29,7 +29,7 @@
<tr *ngFor="let periodeEssai of periodeEssais"> <tr *ngFor="let periodeEssai of periodeEssais">
<th scope="row">{{getCollaborateurById(periodeEssai.collaborateurId).name}} {{getCollaborateurById(periodeEssai.collaborateurId).firstName}}</th> <th scope="row">{{getCollaborateurById(periodeEssai.collaborateurId).name}} {{getCollaborateurById(periodeEssai.collaborateurId).firstName}}</th>
<td> {{getSplitDate(periodeEssai.startingDate.toString())}}</td> <td> {{getSplitDate(periodeEssai.startingDate.toString())}}</td>
<td> {{getSplitDate(periodeEssai.plannedEndingDate.toString())}}</td> <th> {{getSplitDate(periodeEssai.plannedEndingDate.toString())}}</th>
<td> {{periodeEssai.issue}}</td> <td> {{periodeEssai.issue}}</td>
<td><a routerLink="{{periodeEssai.id}}"> Modifier </a></td> <td><a routerLink="{{periodeEssai.id}}"> Modifier </a></td>
</tr> </tr>

@ -45,9 +45,6 @@ export class PeriodeEssaiComponent implements OnInit {
else{ else{
this.periodeEssais = this.periodeEssaisEnCours; this.periodeEssais = this.periodeEssaisEnCours;
} }
console.log(this.periodeEssais)
console.log(this.periodeEssaisEnCours)
console.log(this.periodeEssaisPassees)
} }
getCollaborateurs(): void { getCollaborateurs(): void {
@ -77,6 +74,8 @@ export class PeriodeEssaiComponent implements OnInit {
this.periodeEssaisPassees.push(pe); this.periodeEssaisPassees.push(pe);
} }
}) })
this.periodeEssaisEnCours.sort((b, a) => new Date(b.plannedEndingDate).getTime() - new Date(a.plannedEndingDate).getTime());
this.periodeEssaisPassees.sort((a, b) => new Date(b.plannedEndingDate).getTime() - new Date(a.plannedEndingDate).getTime());
this.initPeriodeEssai(); this.initPeriodeEssai();
}); });
} }

Loading…
Cancel
Save