title: jQuery DatePicker d/m/yy format
body: <p>Working on a problem, and the formatting of the dateFormat is not working as It thought it would. Can anyone see anything that stands out? It works if I change the date to a different format</p>
  <pre><code>var check_in = [[&quot;25/11/2021&quot;, &quot;28/11/2021&quot;]];
  
  if ($(window).width() &gt; 700) {
      $('#arrival, #contact-arrival').datepicker({
          minDate: '0M',
          numberOfMonths: 2,
          beforeShowDay: function(date) {
              var string = jQuery.datepicker.formatDate('d/m/yy', date);
              for (var i = 0; i &lt; check_in.length; i++) {
                if (Array.isArray(check_in[i])) {
                  var from = new Date(check_in[i][0]);
                  var to = new Date(check_in[i][1]);
                  var current = new Date(string);
                  if (current &gt;= from &amp;&amp; current &lt;= to) return false;
                }
              }
              return [check_in.indexOf(string) == -1]
            },
          dateFormat: 'dd M yy',
          onSelect: function (dateText, inst) {
              $('#departure, #contact-departure').datepicker(&quot;option&quot;, &quot;minDate&quot;, dateText);
          }
      });
  </code></pre>
  <p>In the above script, the <code>jQuery.datepicker.formatDate('d/m/yy', date);</code> is not recognizing <code>var check_in = [[&quot;25/11/2021&quot;, &quot;28/11/2021&quot;]];</code></p>
  <p>If I change the code to <code>var string = jQuery.datepicker.formatDate('d/M/yy', date);</code>
  and the format of the array to <code>var check_in = [[&quot;25/Nov/2021&quot;, &quot;28/Nov/2021&quot;]];</code>
  Everything works, but the data is being pulled in the first format 1/1/2021</p>
  <p>Hope someone with a fresh pair of eyes can see what I am doing wrong.</p>
  <p>Many thanks.</p>