Shilpa
Published in : 2022-03-11
I am using kendo calendar datepicker in angular component. Is there any way to disable or hide weekends dates (Saturday & Sunday)?
<kendo-datepicker id="workingDays" [(ngModel)]="workingDay"
format="dd MMMM yyyy">
</kendo-datepicker>
Can I get USA calendar with Kendo library to see the public holidays programmatically? and disable those date from the showing on calendar?
** URGENT **
I need to fix this issue ASAP! Your help is valuable for me.
To disable weekends (Saturday and Sunday) you can use below code.
Add HTML kendo datepicker code:
<kendo-datepicker
[(ngModel)]="value"
[disabledDates]="disabledWeekendDates"
>
</kendo-datepicker>
Add your .ts code as below,
public disabledWeekendDates = (date: Date): boolean => {
//date.getDay() will return day for each days rendering on your calendar / datepicker.
return date.getDay() == 0 || date.getDay() == 6 ? true : false;
};
Hope the given information will be helpful for you.
Shilpa Date : 2022-03-22
Best answers
10
Best answers
10
Thanks, for the quick response, stackblitz demo looks good as per my requirements.
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now