Set KendoDatepicker min date in open event

≯℡__Kan透↙ 提交于 2019-12-11 05:29:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!