Created
August 8, 2012 12:02
-
-
Save sahinsf/3294598 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.frdtPicker').datetimepicker({ | |
onClose: function(dateText, inst) { | |
var endDateTextBox = $('.todtPicker'); | |
if (endDateTextBox.val() != '') { | |
var testStartDate = new Date(dateText); | |
var testEndDate = new Date(endDateTextBox.val()); | |
if (testStartDate > testEndDate) { | |
var testStartDate = new Date(dateText).getTime() + 60000; | |
var testStartDate2 = new Date(testStartDate); | |
endDateTextBox.datetimepicker('setDate', (new Date(testStartDate2))); | |
} | |
} | |
else { | |
var testStartDate = new Date(dateText).getTime() + 60000; | |
var testStartDate2 = new Date(testStartDate); | |
endDateTextBox.datetimepicker('setDate', (new Date(testStartDate2))); | |
} | |
$('.frdtPicker').val(dateText); //endDateTextBox.val()); | |
}, | |
onSelect: function(selectedDateTime) { | |
var start = $(this).datetimepicker('getDate'); | |
$('.todtPicker').datetimepicker('option', 'minDate', new Date(start.getTime())); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment