Edit this page

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 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="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();
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>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy