i am using 2 input fields 1 for start date and another 1 end date I need to display only future 1 month dates in the date picker based on start date

Viewed 28

$("#startDate").datepicker({
    format: 'yyyy-mm-dd',
    todayHighlight: true,
    autoclose: true
})
.on('changeDate', function(ev){
    $("#endDate").datepicker({
        format: 'yyyy-mm-dd',
        todayHighlight: true,
        autoclose: true,
        minDate: ev.date.setDate(ev.date + 30)
    });
});
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.min.js"></script>

<input type="text" id="startDate" name="startDate">
<input type="text" id="endDate" name="endDate">

here i am using 2 input fields one for start date and another for end date I need to display only future one month dates in the date picker based on start date

0 Answers
Related