title: Jquery - DateTimePicker set max datetime
body: <p>I have 2 datetimepicker. 1 is <code>From</code>, another is <code>To</code>.  how to I limit my <code>To</code> datetimepicker to be 30 minutes after <code>From</code>?
  I know how to limit the maximum date, but I dont know how to limit the maximum date and time. </p>
  
  <p>for example :</p>
  
  <p>If <code>From</code> is <code>2016/05/11 00:00</code> then max of <code>To</code> would be <code>2016/05/11 00:30</code>
  But, if <code>From is</code>2016/05/11 23:55<code>then max of</code>To<code>would be</code>2016/05/12 00:25`</p>
  
  <p>my current code :</p>
  
  <pre><code>$("#From").datetimepicker({
      onClose: function (selectedDate, instance) {
         if (selectedDate != '') {
             $("#To").datetimepicker("option", "minDate", selectedDate);
             var date = $.datepicker.parseDateTime("dd/mm/yy", "hh:mm", selectedDate);
             date.setMinutes(date.getMinutes() + 30);
             $("#To").datetimepicker("option", "maxTime", selectedDate);
          }
      }
  });
  $("#To").datetimepicker();
  </code></pre>
  
  <p>this code is not working, and Im at a loss. Should I set the <code>maxDate</code> and <code>maxTime</code> separately?</p>