I am using a bootstrap date picker. when I am selecting the start date, the end date validation works fine for the first time. but when I change the start date again end date limit remains the same, does not change.
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<script !src="">
// Include Date Range Picker -->
let format = 'yyyy-mm-dd';
// Start date
$('.start-date').datepicker({
startDate: new Date(),
format: format,
autoclose: true
});
// End date
$('.start-date').on("change", function() {
$('.end-date').val('');
$('.end-date').datepicker({
startDate: $('.start-date').val(),
format: format,
autoclose: true
});
})
</script>
in on change function i am getting change value of $('.start-date').val() but limit of end-date remains same.