2
$(document).ready(function () {
                debugger;
                var startDate = $find('<%= RdpStartDate.ClientID %>');
                var endDate = $find('<%= RdpEndDate.ClientID %>');
                var end = endDate.get_selectedDate();
                var start = startDate.get_selectedDate();
                startDate.set_minDate(end-90);
              
                });

I'm trying to set start date min value to less than 90 days of end date all before that disabled but this isn't working, help please.

1 Answers1

0

Try to do change the code to the following:

end.setDate(end.getDate() - 90);
startDate.set_minDate(end);

Update:

const endNinety = new Date();
endNinety.setDate(end.getDate())
endNinety.setDate(endNinety.getDate() - 90);
startDate.set_minDate(endNinety);
Toni
  • 1,555
  • 4
  • 15
  • 23