Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set min date for kendo datetime picker

Hi I've a kendo template and that template contains a textbox like below with datetime picker.

<script id="popup_editor" type="text/x-kendo-template">
    <input data-role="datepicker" data-bind="value: datePickerValue" />
</script>

Now I want to set min value for this. i.e I dont want to permit to select previous days than today.

Any example?

like image 680
jestges Avatar asked Jul 25 '13 06:07

jestges


1 Answers

Try this

var myDatePicker = $("#myDatePicker").kendoDatePicker().data("kendoDatePicker");
var today = new Date();
var day = today.getDate();
var month = today.getMonth() + 1;
var year = today.getFullYear();
myDatePicker.min(new Date(year,month,day));
like image 133
Janie B Avatar answered Dec 31 '22 20:12

Janie B