value

Gets/Sets the value of the DatePicker.

Parameters

value Date | String

The value to set.

Returns

Date The value of the DatePicker.

  • This method does not trigger change event. This could affect MVVM value binding. The model bound to the widget will not be updated. You can overcome this behavior trigerring the change event manually using trigger("change") method.
<input id="datepicker" />
<script>
$("#datepicker").kendoDatePicker();

var datepicker = $("#datepicker").data("kendoDatePicker");
datepicker.value(new Date(2016, 10, 1));
datepicker.trigger("change");
</script>

Example - gets the value of the widget

<input id="datepicker" />
<script>
$("#datepicker").kendoDatePicker({
    value: new Date(2013, 10, 10)
});

var datepicker = $("#datepicker").data("kendoDatePicker");

var value = datepicker.value();
console.log(value);
</script>

Example - sets the value of the widget

<input id="datepicker" />
<script>
$("#datepicker").kendoDatePicker({
    value: new Date(2013, 10, 10)
});

var datepicker = $("#datepicker").data("kendoDatePicker");

datepicker.value(new Date());
</script>
In this article
Not finding the help you need? Improve this article