Hi,

I have configured the datetimepicker so when the user selects start date X then end date X will automatically be the same as start date, however I need to make sure it is exactly 1 hour later, I dont want start and end time to be exact.. here is my code:


Code:
					$(function(){
							$('#ending_date').datetimepicker({
							onClose: function(dateText, inst) {
								var startDateTextBox = $('#starting_date');
								if (startDateTextBox.val() != '') {
									var testStartDate = new Date(startDateTextBox.val());
									var testEndDate = new Date(dateText);
									if (testStartDate > testEndDate)
										startDateTextBox.val(dateText);
								}
								else {
									startDateTextBox.val(dateText);
								}
							},
							onSelect: function (selectedDateTime){
								var end = $(this).datetimepicker('getDate');
								$('#starting_date').datetimepicker('option', 'maxDate', new Date(end.getTime()) );
							}
							});
						});
						$(function(){
						  $('#starting_date').datetimepicker({
							  onClose: function(dateText, inst) {
								  var endDateTextBox = $('#ending_date');
								  if (endDateTextBox.val() != '') {
									  var testStartDate = new Date(dateText);
									  var testEndDate = new Date(endDateTextBox.val());
									  if (testStartDate > testEndDate)
										  endDateTextBox.val(dateText);
								  }
								  else {
									  endDateTextBox.val(dateText);
								  }
							  },
							  onSelect: function (selectedDateTime){
								  var start = $(this).datetimepicker('getDate');
								  $('#ending_date').datetimepicker('option', 'minDate', new Date(start.getTime()));
							  }
						  });
						});

<input type="text" id="start_date" name="ending_date" class="deal_form"/>

<input type="text" id="end_date" name="ending_date" class="deal_form"/>