DateTimePicker Forms Support
You can use the DateTimePicker in Template-driven and Reactive forms.
Template-Driven Forms
The template-driven forms enable you to bind the DateTimePicker to the model by using the ngModel directive.
The following example demonstrates how to use the DateTimePicker in template-driven forms.
Reactive Forms
Reactive forms use the FormGroup class to manage the form state. Bind the DateTimePicker to a control in the group by using the formControlName or formControl directive. For more details, refer to the Angular documentation.
The following example demonstrates how to use the DateTimePicker in a reactive form.
Managing the DateTimePicker Disabled State in Reactive Forms
To disable the DateTimePicker component when working with reactive forms and Angular 15 or later, use the FormControl's disabled property/option or disable() method.
Since Angular 15, the
setDisabledStatemethod of the control value accessor is always called to sync the disabled state with the model. As a result, thedisabledproperty of the DateTimePicker no longer disables the component in reactive forms. Set the disabled state through the FormControl instead.
FormField Association
The Kendo UI for Angular FormField component enables you to group form-related elements, such as inputs, labels, hint and error messages, and configure their behavior.
The following example demonstrates how to use the DateTimePicker within a FormField with hint and error messages.