Filter results by Today with date pipe


I’m trying to filter a json object, only showing results that match today’s date.


<ion-item-sliding *ngFor="let job of filteredJobs">
  <div *ngIf="(job.schedule | date: 'MM/dd/yy') == (today | date:'MM/dd/yy')">

I have the *ngIf statement wrong but I don’t know how to fix it.

today is declared in template.ts
today: String = new Date().toISOString();

I have printed out the variables and they are in fact identical 01/22/17. Thanks for any help!


I would prefer to do this sort of work on the component side, instead of in the template, by creating a method that returns only today’s jobs.


Good point @rapropos. I know pipe filtering can slow down the UX considerably.