value

Gets or sets the value of the DateTimePicker.

Parameters

value Date|String

The time value to set for a DateTimePicker, expressed as a Date object or as a string.

Returns

Date The time value of a DateTimePicker.

  • This method does not trigger change event. This can 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="datetimepicker" />
<script>
$("#datetimepicker").kendoDateTimePicker();

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

Example - gets the value of the widget

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

var datetimepicker = $("#datetimepicker").data("kendoDateTimePicker");

var value = datetimepicker.value();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(value);
</script>

Example - sets the value of the widget

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

var datetimepicker = $("#datetimepicker").data("kendoDateTimePicker");

datetimepicker.value(new Date());
</script>
In this article