title: JQuery datepicker - how to change max date on a specific start date?
body: <p>I have the following code:</p>
  
  <pre><code>$(function() {          
  var dates = $( "#from_date, #to_date" ).datepicker({            
  defaultDate: "-1w",
  dateFormat: 'yy-mm-dd',
              onSelect: function( selectedDate ) {
                  if (selectedDate &lt; "2012-03-27" ) {
                      maxDate: new Date(2012, 03 - 1, 27); // it will set minDate from 25 October 2009
                  };
                  var option = this.id == "from_date" ? "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 );
  
              }
          });
  
      });
  </code></pre>
  
  <p>I need the maxDate to to be limited to the 2012-03-27, in case the start date was smaller then that.</p>
  
  <p>I tried EVERYTHING....really desperate here
  thanks,
  Danny</p>