I have this:
var today = new Date();
Updating the kendo datepicker:
$('#datepicker').kendoDatePicker({
max: today.setDate(today.getDate()+30);
});
In the debugger the max value is 1404408808080
but in today variable the date is right one 2014-07-03T17:3
. Want to set the max date for kendodatepicker 30 days from the current date.
kendoDatePicker({ max: today. setDate(today. getDate()+30); });
Steps to add Datepicker – $(document). ready(function(){ $("#setMin,#setMax"). datepicker({ dateFormat: "yy-mm-dd" }); $('#datepicker'). datepicker({ dateFormat: "yy-mm-dd", maxDate:'+1m +10d', minDate: -10 }); });
By default, the DatePicker is enabled. To disable the component, set its disabled property to true .
You have to use the setOptions()
method to change that:
var datepicker = $("#datepicker").data("kendoDatePicker");
datepicker.setOptions({
max: new Date(today.setDate(today.getDate()+30))
});
Or if you want just do this in the initialization:
$("#datepicker").kendoDatePicker({
max: new Date(today.setDate(today.getDate()+30))
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With