title: How do I exclude dates from angular material datepicker?
body: <p>I am using Angular Material and I have a dynamic array of dates that I wish to exclude from my datepicker. In addition I am also trying to exclude Saturdays. How can I return multiple dates with my matDatepickerFilter?
  Keep in mind that I cant hardcode each item of the array individually because the array is fluid and will change both in its values and length after some time.</p>
  
  <p>This is my HTML:</p>
  
  <pre><code>&lt;mat-form-field style="text-align: center;"
  [ngClass]="{'hideTitle': submitted &amp;&amp; f4.houseNumber.errors?.required &amp;&amp; f4.aptNumber.errors?.required}"&gt;
      &lt;input matInput 
        [matDatepicker]="picker" 
        placeholder="Desired Delivery Date" 
        [matDatepickerFilter]="myFilter"
        formControlName="deliveryDate" 
        style="font-family: 'Open Sans Condensed', sans-serif; color:white;"&gt;
      &lt;mat-datepicker-toggle matSuffix [for]="picker" 
      style="color:gold;outline:none;"&gt;&lt;/mat-datepicker-toggle&gt;
      &lt;mat-datepicker touchUi #picker disabled="false"&gt;&lt;/mat-datepicker&gt;
  &lt;/mat-form-field&gt;
  </code></pre>
  
  <p>This is my array:</p>
  
  <pre><code>this.allDupedDates = [
    new Date('2019-04-30T00:00:00+02:00'),
    new Date('2019-04-28T00:00:00+02:00'),
    new Date('2019-05-21T00:00:00+02:00'),
    new Date('2019-05-23T00:00:00+02:00')
  ]
  </code></pre>
  
  <p>And this is the code:</p>
  
  <pre><code>myFilter = (d: Date): boolean =&gt; {
   const time = d.getTime();
   const day = d.getDay();
  for (let i = 0; i &lt; this.allDupedDates.length; i++) {
    var date = this.allDupedDates[i].getTime();
    return time !== date
  }
  return day !== 6;
  }
  </code></pre>