title: jQuery datepicker allow specific dates
body: <p>I have a basic problem and I think I almost found the solution but I can't tell what I did wrong.</p>
  
  <p>I have a multiple jQuery datepicker and I don't want the user to be able to select non working days.</p>
  
  <p>Here is what I've done so far :</p>
  
  <pre><code>function enableAllTheseDays(date) {
      var sdate = moment(date).format('YYYY-MM-DD');
  
      if ($.inArray(sdate, enabledDates) !== -1) {
          return [true];
      }
      console.log(date);
      return [false];
  }
  
  $('#newOrderDates').datepicker({
      todayHighlight: true,
      format: 'yy-mm-dd',
      multidate: true,
      startDate : new Date(),
      beforeShowDay: enableAllTheseDays
  });
  </code></pre>
  
  <p>So the datepicker will be able to select multiple dates and I don't want the user to be able to select past days and non working days.</p>
  
  <p>The array enabledDates looks like this :</p>
  
  <p><a href="https://i.stack.imgur.com/aNwHH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aNwHH.png" alt="enter image description here"></a></p>
  
  <p>What I don't understant is the console displays the non working days, but for some reason, the user is still able to select them with the datepicker ! I guess the error is coming from the return[true] and return [false] but I didn't find any relevant documentation to fix this so far.</p>
  
  <p><a href="https://i.stack.imgur.com/Go1Nh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Go1Nh.png" alt="enter image description here"></a></p>
  
  <p>Thanks for your help.</p>
  
  <p>Louis</p>