setOptions
Sets the options of the DateTimePicker. Use this method if you want to enable/disable a particular feature/option.
When setOptions is called, the DateTimePicker widget will be destroyed and recreated.
Value Behavior
When setOptions is called, the value resolution follows a priority order:
- Explicit value in setOptions: If the
optionsparameter contains avalueproperty, this value takes precedence and updates the component's current value. - Initial value exists: If the
optionsparameter does not contain avalueproperty, and the component was initialized with avalue, the component reverts to the initial value, discarding any user-selected or programmatically set value. - No initial value: If the
optionsparameter does not contain avalueproperty, and the component was initialized without avalue, the component preserves the current value.
Parameters
Changes the initial DateTimePicker configuration.
options Object
The new configuration options.
Example - update the minimum date that the calendar can show
<input id="datetimepicker" />
<script>
$("#datetimepicker").kendoDateTimePicker({
min: new Date(2001, 0, 1),
max: new Date()
});
var datetimepicker = $("#datetimepicker").data("kendoDateTimePicker");
datetimepicker.setOptions({
min: new Date(2010, 5, 6)
});
</script>
In this article