I am using moment.js and bootstrap-datetimepicker by eonasdan. I have two datetimepicker in my page. One is for startdate of arrival and the other one is for enddate.
I would like to disable all dates on datetimepicker 2 before selected date on datetimepicker 1.
<form id="form" name="form" class="form-inline">
<div class="form-group">
<label for="startDate">Start Date</label>
<input id="startDate" name="startDate" type="text" class="form-control"
/>
<label for="endDate">End Date</label>
<input id="endDate" name="endDate" type="text" class="form-control" />
</div>
</form>
And the javascript block:
$(window).load(function(){
$('#startDate').datetimepicker({
minDate: moment()
});
$('#endDate').datetimepicker({
maxDate: moment()
});
});