title: How to set maxDate and minDate with jquery ui datepicker?
body: <p>I have date range below example and I want to set minimum date for my <code>#checkout</code> input. after selected a days from my <code>#checkin</code>.<code>#checkout</code> search date can't be more than 15 days for date range that is why I want to prevent it</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
  
    var dateFormat = "DD/MM/YY",
      from = $("#checkin,.checkin").datepicker({
        numberOfMonths: 2,
        firstDay: 1,
        minDate: 0,
        onSelect: function(selectedDate) {
  
          window.setTimeout($.proxy(function() {
            $(this).parents(".book-holiday").find("#checkout,.checkout").focus();
          }, this), 10);
          var yenitarih = new Date();
          var date = $(this).datepicker('getDate');
          date.setTime(date.getTime() + (1000 * 60 * 60 * 24));
  
          $("#checkout,.checkout").datepicker("option", "minDate", date);
        },
        isTo1: true,
      }).on("change", function() {
        to.datepicker("option", "minDate", getDate(this));
      }),
      to = $("#checkout,.checkout").datepicker({
        firstDay: 1,
        numberOfMonths: 2,
        minDate: 0,
        maxDate: +15,
        onSelect: function(selectedDate) {
          $(this).parents(".book-holiday").find(".popover-wrapper").addClass("open");
          $("#checkin,.checkin").datepicker("option", "maxDate", selectedDate);
        },
      }).on("change", function() {
        from.datepicker("option", "maxDate", getDate(this));
      });
  
  
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.0/css/smoothness/jquery-ui-1.10.0.custom.min.css" rel="stylesheet" /&gt;
  
  &lt;div class="book-holiday"&gt;
    &lt;input type="text" id="checkin" /&gt;
    &lt;input type="text" id="checkout" /&gt;
  &lt;/div&gt;
  
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>