The DatePicker allows the end user to select a date from a calendar or by direct input. It supports custom templates for "month" view, configurable options for min and max date, start view and the depth of the navigation.
<input id="datePicker" />
$(document).ready(function(){
$("#datePicker").kendoDatePicker();
});
When a DatePicker is initialized, it will be displayed at the location of the target HTML element.
The DatePicker provides configuration options that can be set during initialization. Among the properties that can be controlled:
$(document).ready(function(){
$("#datePicker").kendoDatePicker({
value: new Date(),
min: new Date(1950, 0, 1),
max: new Date(2049, 11, 31)
})
});
DatePicker will set the value only if the entered date is valid and within the defined range.
The first rendered view can be defined with "start" option. Navigation depth can be controlled with "depth" option. Predefined views are:
$("#datePicker").kendoDatePicker({
start: "year",
depth: "year"
});
You can reference an existing DatePicker instance via jQuery.data(). Once a reference has been established, you can use the API to control its behavior.
var datePicker = $("#datePicker").data("kendoDatePicker");