title: Disable specific dates using datepicker in Angular Material
body: <p>I'm trying to disable specific dates in a calendar so a user can't select the dates in question - please see <a href="https://plnkr.co/edit/PwCLKWPQU0s3habxgUly?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/PwCLKWPQU0s3habxgUly?p=preview</a>.</p>
  
  <p>The only issue here is that I can only disable one date when returning the value to the filter, whereas in this case there are two example dates I was wanting to disable. I can also hard-code the two dates in the return statement, yet for my actual project the array of disabled dates is unknown.</p>
  
  <p>Here is the JS:</p>
  
  <pre><code>var bookedDates = [new Date(2016, 10, 25).toString(), new Date(2016, 10, 10).toString()];
  
  $scope.onlyWeekendsPredicate = function (date) {
      var day = date.getDate();
      var month = date.getMonth();
      var year = date.getFullYear();
      var todaysDate = new Date (year, month, day).toString();
  
      var confirmedBookingDates = [];
  
      for (var n = 0; n &lt;= bookedDates.length; n++) {
          if (todaysDate != bookedDates[n]) {
              confirmedBookingDates[n] = true;
          }
          return confirmedBookingDates[n];
      }
  
  };
  </code></pre>