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

Calendar Disable Weekends

4 Answers 77 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Licensing
Top achievements
Rank 1
Licensing asked on 28 Oct 2014, 06:51 PM
Hi Telerik,

Our business needs require that we only allow cells that fall on week days to be enabled. Searching through the documentation the only reference I've found to disabling cells requires a min and max date which creates a range of enabled cells while the rest are disabled. In the context of range selection this make sense, but for our needs its not applicable since we essentially only want the weekends to be disabled, and not the dates in between.

I've a way to sort of implement this behaviour by extending the Calendar adapter class and shading the calendar cell as disabled in my getDateView method if it falls on a sunday or saturday, but this of course does not actually disable the cell. I was hoping that setEnabled(false) would do the trick, but this does not seem to work with the framework provided. Is there a way I could achieve this functionality while still holding true to the way the framework was meant to be utilized?

I've attached a png file that illustrates what I have envisioned.

Thanks for your time,
Amadeus

4 Answers, 1 is accepted

Sort by
0
Licensing
Top achievements
Rank 1
answered on 28 Oct 2014, 06:54 PM
Attachment seems to have gotten lost...trying again
0
Todor
Telerik team
answered on 29 Oct 2014, 07:57 AM
Hi Amadeus,

You are right that currently the only way to set dates as disabled is by setting a minDate-maxDate range. Then, the dates out of that range will be disabled.

However, since your scenario seems quite reasonable, we are going to add a way to make cells disabled based on the date that they represent as in your requirement. The new feature will be included in our Service Pack release which will arrive in early December.

Thank you for the suggestion.

Regards,
Todor
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Licensing
Top achievements
Rank 1
answered on 29 Oct 2014, 07:59 PM
Awesome Todor! That would be great and much appreciated. The time frame will work for us as well.
0
Todor
Telerik team
answered on 30 Oct 2014, 07:43 AM
Great!

Then stay tuned for the Service Pack release.

Regards,
Todor
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Calendar
Asked by
Licensing
Top achievements
Rank 1
Answers by
Licensing
Top achievements
Rank 1
Todor
Telerik team
Share this question
or