title: JQuery DateTimePicker add hours
body: <p>I am using the following code, <code>datepicker</code> from <code>jquery</code>, to pick up a date from a calendar. When I select a date for the first field then this date and time will be entered in the second field too. </p>
  
  <p>What I need is but to enter the date and time in the second field with addition of 10 hours (addHours(10)). I tried some options but did not succeed. Could you please advice where to put the code, <code>.addHours(10)</code>, to get result in the second field?</p>
  
  <pre class="lang-js prettyprint-override"><code>var startDateTextBox = $('#rest_example_4_start');
  var endDateTextBox = $('#rest_example_4_end');
  
  startDateTextBox.datetimepicker({ 
      onClose: function(dateText, inst) {
          if (endDateTextBox.val() != '') {
              var testStartDate = startDateTextBox.datetimepicker('getDate');
              var testEndDate = endDateTextBox.datetimepicker('getDate');
  
              if (testStartDate &gt; testEndDate)
                  endDateTextBox.datetimepicker('setDate', testStartDate);
          } else {
              endDateTextBox.val(dateText);
          }
      },
      onSelect: function (selectedDateTime) {
          endDateTextBox.datetimepicker('option', 'minDate',  startDateTextBox.datetimepicker('getDate'));        
      }
  });
  
  endDateTextBox.datetimepicker({ 
      onClose: function(dateText, inst) {
          if (startDateTextBox.val() != '') {
              var testStartDate = startDateTextBox.datetimepicker('getDate');
              var testEndDate = endDateTextBox.datetimepicker('getDate');
  
              if (testStartDate &gt; testEndDate)
                  startDateTextBox.datetimepicker('setDate', testEndDate);
          }
          else {
          startDateTextBox.val(dateText);
          }
      },
      onSelect: function (selectedDateTime){
          startDateTextBox.datetimepicker('option', 'maxDate', endDateTextBox.datetimepicker('getDate')) 
          startDateTextBox.addHours(10);
      }
  });
  </code></pre>