title: Woocommerce Checkout Field editor, Datepicker restrict array of dates and restrict the closest 5 days
body: <p>I think maybe i wasn´t to clear in my question.</p>
  <p>I want to do two things with my jquery datepicker (in this case its a part of woocommerce custom checkout fields add on)</p>
  <p>1: Disable the next 5 days in the calendar.
  2: Disable certain days/periods like holidays, closed days etc.</p>
  <p>I´ve been able to achive both of these individually with the following functions but they don´t work when I use them both. Then only #2 works.
  Any good suggestions?</p>
  <p>How can I combine these two functions I´ve found so far:</p>
  <p>This one who restrict the closest 5 days.</p>
  <pre><code>add_filter( 'wp_footer' , 'woo_add_checkout_field_date_range_limit' );
  function custom_adjust_datepicker_range () {
      if ( is_checkout() ) {
          wp_enqueue_script( 'jquery' );
  ?&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
  jQuery( document ).ready( function ( e ) {
      if ( jQuery( '.checkout-date-picker' ).length ) {
          jQuery( '.checkout-date-picker' ).datepicker( 'option', 'minDate', '+5' );
      }
  });
  &lt;/script&gt;
  &lt;?php
      }
  } // End custom_adjust_datepicker_range()
  add_action( 'wp_footer', 'custom_adjust_datepicker_range', 50 );
  </code></pre>
  <p>And this that block an array of dates (holidays etc...)</p>
  <pre><code>add_action('wp_footer', 'wp_footer_callback');
  function wp_footer_callback(){
  ?&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
      jQuery(document).on('ready', function(){
          var unavailableDates = [&quot;21-11-2020&quot;, &quot;22-11-2020&quot;, &quot;23-11-2020&quot;];
          function unavailable(date) {
              dmy = date.getDate() + &quot;-&quot; + (date.getMonth() + 1) + &quot;-&quot; + date.getFullYear();
              if (jQuery.inArray(dmy, unavailableDates) == -1) {
                  return [true, &quot;&quot;];
              } else {
                  return [false, &quot;&quot;, &quot;Unavailable&quot;];
              }
          }
          jQuery(&quot;.checkout-date-picker&quot;).datepicker(&quot;destroy&quot;);
          jQuery(&quot;.checkout-date-picker&quot;).datepicker({
              dateFormat: 'dd MM yy',
              beforeShowDay: unavailable
          });
  
      });
  &lt;/script&gt;
  &lt;?php   
  }
  </code></pre>
  <p>I tried to add the</p>
  <pre><code>jQuery( '.checkout-date-picker' ).datepicker( 'option', 'minDate', '+5' );
  </code></pre>
  <p>in with the</p>
  <pre><code>jQuery(&quot;.checkout-date-picker&quot;).datepicker(&quot;destroy&quot;);
  jQuery(&quot;.checkout-date-picker&quot;).datepicker({
  </code></pre>
  <p>Did not work.</p>
  <p>I appologize for the newbie question and I probably could have found the answer somewhere else too, but then again. This is always a good source to good guidance.</p>