I have two datepickers named startdate and enddate. I want to disable all other dates except the selected date, starting from the start date. for example, if I selected 12/15/2016 from startdate datepicker, then I want to disable all other dates at the end of the date, except for the 15th day.
Demofiddle: https://jsfiddle.net/d7vzxn8s/
This is my code:
<p>Start Date: <input type="text" id="startdate"></p> <p>End Date: <input type="text" id="enddate"></p> <script> $("#startdate").datepicker({ onSelect: function (selected) { var dt = new Date(selected); dt.setDate(dt.getDate()); $("#enddate").datepicker("option", "minDate", dt); } }); $("#enddate").datepicker();
source share