Calendar Disable Weekends

5 posts, 0 answers
  1. Licensing
    Licensing avatar
    16 posts
    Member since:
    Jul 2006

    Posted 28 Oct 2014 Link to this post

    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
  2. Licensing
    Licensing avatar
    16 posts
    Member since:
    Jul 2006

    Posted 28 Oct 2014 in reply to Licensing Link to this post

    Attachment seems to have gotten lost...trying again
  3. DevCraft banner
  4. Todor
    Admin
    Todor avatar
    778 posts

    Posted 29 Oct 2014 Link to this post

    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.

     
  5. Licensing
    Licensing avatar
    16 posts
    Member since:
    Jul 2006

    Posted 29 Oct 2014 Link to this post

    Awesome Todor! That would be great and much appreciated. The time frame will work for us as well.
  6. Todor
    Admin
    Todor avatar
    778 posts

    Posted 30 Oct 2014 Link to this post

    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.

     
Back to Top
DevCraft banner