Thursday, October 27, 2016

Disable Future And Past Date of jQuery Calendar In ASP.NET MVC

$(document).ready(function() { 
    $("#EnterDate").datepicker({ 
        dateFormat:"dd-mm-yy"
        minDate: -0, 
        maxDate: "+0M +0D" 
 
    }); 
});

 ---------------------
 Now let us change the maxDate property to enable only five days from current date
$(document).ready(function() {  
    $("#EnterDate").datepicker({  
        dateFormat:"dd-mm-yy"
        minDate: -0,  
        maxDate: "+0M +4D"  
  
    });  
});