title: How to disable specific date materialize
body: <p>Here is a javascript made by materialize, and I am trying to disable specific dates. But I tried a lot of code here but could not get any result from this. </p>
  
  <pre><code>&lt;script&gt;
  
  var dateToday = new Date();
  $('.datepicker').pickadate({
    selectMonths: true,
    selectYears: 40,
    format: "yyyy-mm-dd",
    min: dateToday,
    max: new Date(2030, 11, 31),
    closeOnSelect: true,
      onOpen: function () {
        this.clear();
      },
      onSet: function () {
        var x,y,year,date,month;
        x = $('.datepicker1').pickadate().val().toString();
        y = x.split(/[ ,]+/);
        date = y[0];
        month = y[1];
        year = y[2];
        console.log(y[0]+" "+ y[1]+ " "+ y[2]);
        if(date &amp;&amp; month &amp;&amp; year){
          this.close();
        }
      }
  });
  
  $("#mcDateFrom").click(function(event) {
    event.stopPropagation();
    $("#mcDateFrom").first().pickadate("picker").open();
  });
  $("#mcDateTo").click(function(event) {
    event.stopPropagation();
    $("#mcDateTo").first().pickadate("picker").open();
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I am also trying the below code also.</p>
  
  <pre><code> var array = ["2018-06-28","2013-03-15","2013-03-16"]
  
  $('.datepicker').pickadate({
      beforeShowDay: function(date){
          var string = jQuery.pickadate.formatDate('yyyy-mm-dd', date);
          return [ array.indexOf(string) == -1 ]
      }
  });
  </code></pre>
  
  <p>But no result after trying a lot of things as well as this code. I need help. Thanks in advance.</p>