I have two dates: a Min and a Max, like seen on the linked picture. How do I set so that when the page loads, that the minimum date is set for the "Max date" field when rendering the page? So that the days become unselectable. I've tried "onload" like:
onLoad: function (selectedDate) {
if (this.id == 'datetimepickerFrom') {
var dateMin = $('#datetimepickerFrom').datepicker("getDate");
var rMin = new Date(dateMin.getFullYear(), dateMin.getMonth(), dateMin.getDate());
$('#datetimepickerTo').datepicker("option", "minDate", rMin);
}
}
The days still remain selectable when the page loads. The days only become unselectable on the "Max date" field when a user clicks in the "Min date" input field.
Using: jQuery UI default widget
