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

DatePicker

2 Answers 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 17 Sep 2018, 05:13 PM

On the date picker, how do you restrict the user from selecting past date? 

Example: If today is 9/17/2018 , the datepicker should prevent user from selecting 9/16 , 9/15 ....

 

Thanks,

Bryian Tan

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 18 Sep 2018, 09:08 AM
Hello Bryian,

You can use the "min" property of the DatePicker component to set the earliest date that will be available for selection in the calendar (and the max option in a similar manner for the latest available date), e.g.:

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

For example, using September the 17th as min:

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

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Patrick
Top achievements
Rank 1
answered on 21 Sep 2018, 12:32 PM

Thanks. 

public min: Date = new Date();

 

Bryian Tan.

Tags
General Discussions
Asked by
Patrick
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or