Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <table mat-table [dataSource]="billingLines" class="mat-elevation-z8">
  2.  
  3. <!-- Other columns comes here -->
  4.  
  5. <ng-container matColumnDef="period">
  6. <th mat-header-cell *matHeaderCellDef> Période </th>
  7. <td mat-cell *matCellDef="let element; let i=index;">
  8. <p>{{element.getPeriodString()}}</p>
  9. </td>
  10. </ng-container>
  11.  
  12. <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
  13. <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
  14. </table>
  15.  
  16. @Input() billingLines: ContractBillingLine[] = [];
  17.  
  18. export class ContractBillingLine {
  19. constructor(
  20. public ligneTitle: string,
  21. public creditNote: boolean,
  22. public startPeriod: Date,
  23. public endPeriod: Date,
  24. public sumHT: number,
  25. public sumTVA: number,) {
  26. }
  27.  
  28. public getPeriodString(): string {
  29. return "Du " + moment(this.startPeriod).format("dd/mm/yyyy") + moment(this.endPeriod).format("dd/mm/yyyy");
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement