Shilpa
11 Mar 2022
Angular
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"
class="m-2 col-12" 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.
Rakshit
18 Mar 2022
To disable weekends (Saturday and Sunday) you can use below code.
Add HTML kendo datepicker code:
<kendo-datepicker style="padding:5px;"
[(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.
© 2024 Copyrights reserved for web-brackets.com