This is a migrated thread and some comments may be shown as answers.

[disabledDatesValidation] not available in reactive form?

2 Answers 173 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 16 Sep 2020, 05:24 PM
Is this really not available in a reactive form? If so, how do you get this error displayed in the UI?

2 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 18 Sep 2020, 08:09 AM

Hello Brian,

The disabledDatesValidation input is available regardless of the types of Angular forms the component is used in. The default value is true, so even omitting the option from the template configuration will result in invalidating the form control, if a disabled date is entered.

Can you please share what made you think that it is not available in a Reactive Form?

Here is an example demonstrating this behavior in a Reactive Form:

https://stackblitz.com/edit/angular-hdj6e2?file=app/app.component.ts

Note that Saturdays and Sundays are disabled, and cannot be chosen from the Calendar, but can be entered as dates in the input. When this is done, the whole form control becomes invalid, and the respective error is printed in the box on the top:

Further details about disabling dates are available in the following documentation section:

https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/disabled-dates/#toc-disabled-dates

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
Brian
Top achievements
Rank 1
answered on 18 Sep 2020, 04:29 PM
Thanks Dimiter! Perhaps I needed to have a [disabledDates] input along with the [disabledDatesValidation].  I've moved on to a different solution but thanks for the response!
Tags
DatePicker
Asked by
Brian
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Brian
Top achievements
Rank 1
Share this question
or