value
Gets or sets the value of the TimePicker.
Parameters
value Date|String
The time value to set for a TimePicker, expressed as a Date object or as a string.
Returns
Date
The time value of a TimePicker.
- 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="timepicker" />
<script>
$("#timepicker").kendoTimePicker();
var timepicker = $("#timepicker").data("kendoTimePicker");
timepicker.value(new Date(2016, 10, 1));
timepicker.trigger("change");
</script>
Example - gets the value of the widget
<input id="timepicker" />
<script>
$("#timepicker").kendoTimePicker({
value: "10:00 AM"
});
var timepicker = $("#timepicker").data("kendoTimePicker");
var value = timepicker.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="timepicker" />
<script>
$("#timepicker").kendoTimePicker();
var timepicker = $("#timepicker").data("kendoTimePicker");
timepicker.value("10:00 AM");
</script>