title: datetimepicker update mindate maxdate
body: <p>I am using jquery datetimepicker for two textboxes From date To date. I want to update the values mindate and maxdate from the other text box. The first time it is working fine but if I change the values on debug are correct but the datetimepicker doesnt update. My question is how I will make datetimepicker to update. Reading the code I think it is more clear. Thank you</p>
  
  <pre><code>    $(".DatePickerFieldOnHire").live('click', function () {
  
          var defaultDateTime = "";
          var dateFrom = "";
          var dateTo = "";
          dateFrom = document.getElementById('WebReportForm1_Value_DeliveryDate').value;
          dateTo = document.getElementById('WebReportForm1_Value_ExpectedRedeliveryDate').value;
          var now = new Date();
          var dateNow=now.format("dd-mm-yy HH:mm z");
  
  dateFrom = document.getElementById('WebReportForm1_Value_DeliveryDate').value;
              dateTo = document.getElementById('WebReportForm1_Value_ExpectedRedeliveryDate').value;
              var now = new Date();
              var dateNow=now.format("dd-mm-yy HH:mm z");
  
              if (dateFrom == null) {
                  dateFrom = new Date(1999, 10 - 1, 25);
              }
              if (dateTo == null) {
                  dateTo = new Date(2055, 10 - 1, 25);
                  defaultDateTime = dateNow;
              } else {
                  if (dateTo &gt; dateNow) {
                      defaultDateTime = dateNow;
                  }
                  else {
                      defaultDateTime = dateTo;
                  }
              }          
              var inputOff = "";
              inputOff = $('[id*="OffHireDateField"]').val();
              if (inputOff != "") {
                 dateFrom = inputOff;
              }
  
              $(this).datetimepicker({
               showOn: 'focus', showTimezone: false, ampm: true, dateFormat: "dd-mm-yy",
                  timeFormat: "HH:mm z",
                  minDate: dateFrom,
                  maxDate: dateTo,
                  showTimezone: true,
                  defaultDate: defaultDateTime,
                  onSelect: function () { }
              }).focus();
  
          });
  </code></pre>
  
  <p>and the From textbox</p>
  
  <pre><code> $(".DatePickerFieldOffHire").live('click', function () {
  
          var dateFrom = "";
          var dateTo = "";
          dateFrom = document.getElementById('WebReportForm1_Value_DeliveryDate').value;
          dateTo = document.getElementById('WebReportForm1_Value_ExpectedRedeliveryDate').value;
  
  
          if (dateFrom == null) {
              dateFrom = new Date(1999, 10 - 1, 25);
          }
  
          if (dateTo == null) {
              dateTo = new Date(2055, 10 - 1, 25);
              defaultDateTime = dateNow;
          } else {
              if (dateTo &gt; dateNow) {
                  defaultDateTime = dateNow;
              }
              else {
                  defaultDateTime = dateTo;
              }
          }
  
          var inputOn = "";
          inputOn = $('[id*="OnHireDateField"]').val();
          if (inputOn != "") {
              dateTo = inputOn;
          }
  
          $(this).datetimepicker({
              showOn: 'focus', showTimezone: false, ampm: true, dateFormat: "dd-mm-yy",
              timeFormat: "HH:mm z",
              minDate: dateFrom,
              maxDate: dateTo,
              showTimezone: true,
              defaultDate: defaultDateTime,
              onSelect: function () { }
          }).focus();
  
      });
  </code></pre>