问题
I want to display past date in kendo datepicker input ,but want disable the past dates in the calender. For example , I am getting date value as 1st Oct from DB. SO I want to display the same in the date input but when user opens the kendo datepicker , i want to disable the past dates as part of validation. I tried with min: new Date() of kendo datepicker but in this case i am not able to display my data from DB
Can anyone help me on this.
回答1:
Try below solution.
http://jsfiddle.net/vojtiik/ATmHG/4/
var todaysDate = new Date();
var pastDate = new Date(2013, 1, 1);
var dp = $("#datepicker").kendoDatePicker({
value: pastDate,
min: pastDate,
open: function(e) {
if ( dp.min() == pastDate) {
dp.value(todaysDate);
dp.min(todaysDate);
}
}
}).data("kendoDatePicker");
来源:https://stackoverflow.com/questions/19487459/set-kendodatepicker-min-date-in-open-event