@Html.TextBoxFor(m => m.EndDate, new {
@class = "disableFuturedate", @readonly = "readonly", @data_uk_datepicker = "{format: 'DD/MM/YYYY'}"
})
and also write into script
var currentDate = new Date();
$('.disableFuturedate').datepicker({
maxDate: currentDate
}).on('changeDate', function(ev) {
$(this).datepicker('hide');
});
$('.disableFuturedate').keyup(function() {
if (this.value.match(/[^0-9]/g)) {
this.value = this.value.replace(/[^0-9^-]/g, '');
}
});