title: disabling specific dates from html datepicker jquery
body: <p>hey guys i am trying to set a datepicker in my webpage and disable some dates from it so it can't be showing<br>
  this is the code:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;title&gt;Untitled Document&lt;/title&gt;
  
          &lt;link href="jquery-ui/jquery-ui.css" rel="stylesheet"&gt;
          &lt;script src="jquery-ui/external/jquery/jquery.js" &gt;&lt;/script&gt;
          &lt;script src="jquery-ui/jquery-ui.js"&gt;&lt;/script&gt;
  
          &lt;script&gt;
  
              /** Days to be disabled as an array */
              var disableddates = ["20-5-2015", "12-11-2014", "12-25-2014", "12-20-2014"];
  
              function DisableSpecificDates(date) {
  
                  var m = date.getMonth();
                  var d = date.getDate();
                  var y = date.getFullYear();
  
                  // First convert the date in to the mm-dd-yyyy format 
                  // Take note that we will increment the month count by 1 
                  var currentdate = (m + 1) + '-' + d + '-' + y;
  
                  // We will now check if the date belongs to disableddates array 
                  for (var i = 0; i &lt; disableddates.length; i++) {
  
                      // Now check if the current date is in disabled dates array. 
                      if ($.inArray(currentdate, disableddates) != -1) {
                          return [false];
                      }
                  }
              }
  
              $(function () {
                  $("#date").datepicker({
                      beforeShowDay: DisableSpecificDates
                  });
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;input id="date" type="text"&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but it is not working for some reason... the date picker don't even show 
  can someone plz help</p>