如何在角度材料表中过滤日期

时间:2019-04-01 15:51:36

标签: angular command-line-interface

enter image description here,当我在过滤器文本框中输入日期时,结果是按月过滤,但如果输入日期为11,则按日期过滤时,列过滤器显示的过滤器数据为12。 用于过滤的component.ts代码

applyFilter(filterValue: string) {
    this.dataSource.filter = filterValue.trim().toLowerCase();
  }

component.html用于日期过滤的代码

<ng-container matColumnDef="deliveryDate">
<mat-header-cell *matHeaderCellDef mat-sort-header> Delivery Date MM-DD-YYYY </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.deliveryDate  | date:'MM-dd-yyyy'}} </mat-cell>
</ng-container>

0 个答案:

没有答案