title: Jquery UI date picker Date range 6 month Limit
body: <p>I am using jQuery ui date picker (date range)  I want to restrict it to 6 months </p>
  
  <pre><code>var dates = $("#availability_date_from, #availability_date_to").datepicker({
          defaultDate: "+1w",
          changeMonth: true,
          numberOfMonths: 1,
          minDate:'0',
  
          yearRange:'c-18:c',
  
          onSelect: function( selectedDate ) {
  
              var option = this.id == "availability_date_from" ? "minDate" : "maxDate",
  
                  instance = $( this ).data( "datepicker" ),
  
                  date = $.datepicker.parseDate(
                      instance.settings.dateFormat ||
                      $.datepicker._defaults.dateFormat,
                      selectedDate, instance.settings );
              dates.not( this ).datepicker( "option", option, date );
  
  
              if(this.id == "availability_date_to"){
  
                  commonJSComplete(this.value,'availability_date_to');
                  $('#responsecontainer').load('profilemeter.php');
              }
              else if(this.id == "availability_date_from"){
                  commonJSComplete(this.value,'availability_date_from');
              }
  
          }
  
      });
  </code></pre>