title: DatePicker disable national days + 48h + weekend
body: <p>I know, the title isn't really specific, but I have a problem with <code>DatePicker</code>. I try to disable the national days, weekend and 48 hours after today. For the moment I did this :</p>
  
  <ul>
  <li>Hide today + 48hours, I use <code>minDate: 3</code></li>
  <li>Hide weekend</li>
  <li>Hide national days, they are saved in an array</li>
  <li>Hide (today + 48h) + weekend (5 days to disable), code in <code>beforeShow</code> attribute</li>
  </ul>
  
  <p>My code look like this for the moment :</p>
  
  <pre><code>function noWeekendsOrHolidays(date) {
      var dateTime = new Date();
      var dayOfWeek = dateTime.getDay();
      var noWeekend = $.datepicker.noWeekends(date);
  
      if (noWeekend[0]) {
          natDays = [
              [1, 1, 'au'], [5, 1, 'ar'], [5, 8, 'ar'], [7, 14, 'us'], [8, 15, 'id'], [11, 1, 'lb'], [11, 11, 'lb'], [12, 25, 'ke']
          ];
  
          for (i = 0; i &lt; natDays.length; i++) {
              if (date.getMonth() == natDays[i][0] - 1 &amp;&amp; date.getDate() == natDays[i][1]) {
                  return [false, ''];
              }
          }
          return [true, ''];
      } else {
          return noWeekend;
      }
  }
  
  function addDatePicker(pSelname)
  {
      $(pSelname).datepicker({
          stepMonths: 1,
          firstDay: 1,
          regional:'fr',
          dayNamesShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
          dayNamesMin:  ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
          dayNames: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
          monthNames: ['Janvier','Fevrier','Mars','Avril','Mai','Juin','Juillet','Aout','Septembre','Octobre','Novembre','Décembre'],
          monthNamesShort: ['Jan','Fev','Mai','Avr','Mai','Juin','Juil','Aou','Sep','Oct','Nov','Dec'],
          dateFormat: 'dd-mm-yy',
          beforeShowDay: noWeekendsOrHolidays,
          minDate: 3,
          beforeShow : function() {
              var dateTime = new Date();
              var dayOfWeek = dateTime.getDay();
              if(dayOfWeek == 4 || dayOfWeek == 5) {
                  $(this).datepicker( "option", "minDate", "5" );
              }
          }
      });
  }
  </code></pre>
  
  <p>So, I don't know how to handle the case : (today + 48hours) + weekend + national day in the week. I wrote several cases that I need to reproduce on the <code>DatePicker</code> : </p>
  
  <ul>
  <li>If the current day is <strong>monday 14 September</strong>, and if there is a national day (<em>2015-09-14 or 2015-09-15 or 2015-09-16 or 2015-09-17</em>), the next day selectable will be friday 2015-09-18. 
  <br>((today + 48h) + 1 national day = 4 days disable)</li>
  <li>If the current day is <strong>Thuesday 15 September</strong>, and if there is a national day (<em>2015-09-15 or 2015-09-16 or 2015-09-17 or 2015-09-18</em>), the next day selectable will be monday 2015-09-21. 
  <br>((today + 48h) + 1 national day + weekend = 6 days disable)</li>
  <li>If the current day is <strong>Wednesday 16 September</strong>, and if there is a national day (<em>2015-09-16 or 2015-09-17 or 2015-09-18 or 2015-09-21</em>), the next day selectable will be Thuesday 2015-09-22.
  <br>((today + 48h) + 1 national day + weekend = 6 days disable)</li>
  <li>If the current day is <strong>Thursday 17 September</strong>, and if there is a national day (<em>2015-09-17 or 2015-09-18 or 2015-09-21 or 2015-09-22</em>), the next day selectable will be wednesday 2015-09-23.
  <br>((today + 48h) + 1 national day + weekend = 6 days disable)</li>
  <li>If the current day is <strong>friday 18 September</strong>, and if there is a national day (<em>2015-09-18 or 2015-09-21 or 2015-09-22 or 2015-09-23</em>), the next day selectable will be thursday 2015-09-24.
  <br>((today + 48h) + 1 national day + weekend = 6 days disable)</li>
  </ul>
  
  <p>I don't count if there is a national days in the weekend.</p>
  
  <p>The function <code>noWeekendsOrHolidays</code> is executed for each day in the month, so I need to check day by day if there is a national day.</p>
  
  <p><a href="https://jsfiddle.net/5zmv2g7c/" rel="nofollow"><strong>JS FIDDLE</strong></a></p>
  
  <p>So my first question is : This is really possible to do? Which algorithm can I make to resolve that problem?</p>
  
  <p>Thanks</p>