title: How to block specific dates in a Datepicker?
body: <p>I am using date picker to pull a calendar on my store.</p>
  
  <p>However, I am having issue with it.</p>
  
  <p>I am trying to block specific dates and also have the calendar move to the next day after a certain time.</p>
  
  <p>I try the following code</p>
  
  <pre><code>jQuery(function($){
      $("#attrib-11-0").datepicker({minDate: new Date().getHours() &gt;= 13 ? 1 : 0});
  
      //replace these with the id's of your datepickers
      $("#attrib-11-0").datepicker({
  
        beforeShowDay: function(date){          
           var disabledDays = ["10-2-2020", "11-2-2020","12-2-2020","13-2-2020","14-2-2020"];
           var day = date.getDay();
           var string = jQuery.datepicker.formatDate('d-m-yy', date);
           var isDisabled = ($.inArray(string, disabledDays) != -1);
  
           //day != 0 disables all Sundays
           return [day != 0 &amp;&amp; !isDisabled];
  
        }
      });
  </code></pre>
  
  <p>Unfortunately it is not working. </p>
  
  <p>If I remove this, the dates are blocked properly. If I leave it in, the calendar goes to the next day after the specified time but the dates and Sunday are unblocked.</p>
  
  <pre><code>$("#attrib-11-0").datepicker({minDate: new Date().getHours() &gt;= 13 ? 1 : 0});
  </code></pre>
  
  <p>What am I doing wrong?</p>