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

[Solved] Need to lock down every second Saturday

3 Answers 95 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 20 Oct 2009, 05:43 PM
Hi there,

I am using the v2.0.50727 version of the radSCheduler.

My client requires the second Saturday of each week to be unavailable to users to book appointments.

Is there any way to somehow block the second Saturday, disable it, or have it filled in with a locked appointment?

Any suggestions would be greatly appreciated.

Thanks,
Roland

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Oct 2009, 08:19 AM
Hi Roland,

Attach OnClientAppointmentInserting and try the following clientside code in order to prevent inserting appointment in second saturday.

JavaScript:
 
<script type="text/javascript"
    function OnClientAppointmentInserting(sender, args) { 
        var dt = new Date(); 
        dt = args.get_startTime(); 
        var weekNum = dt.getDay(); 
        var day = dt.getDate(); 
        if(day <14 && day>8 && weekNum == 6) 
        { 
            args.set_cancel(true); 
            alert("Cannot insert");     
        } 
    } 
</script> 

-Shinu.
0
Roland
Top achievements
Rank 1
answered on 21 Oct 2009, 04:50 PM
Thanks Shinu

An alert was one of my considerations but I would rather stop the user before they get to an alert.

The thoughts I had were:
  1. Pre-book all users by adding an appointment in the DB on every second saturday.
    • This requires altering DB scripts, and code to insert these appointments, OR, adding a "closed" appointment onLoad (if that's possible).
    • If this was the only solution, can an appointment be locked, or disabled
  2. Change the workdays onLoad
    • but this would only work in week view I think
    • Can you disable dates on the calendar for month view (i.e. show every second saturday as grayed out)?

Thanks!

Roland

0
Peter
Telerik team
answered on 23 Oct 2009, 08:36 AM
Hi Roland,

Please, refer to this kb article:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/setting-special-days-or-time-slots-in-radscheduler.aspx

You can handle SlotCreated to check which day it is and set the CssClass property to disable that day via css.


Cheers,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Roland
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Roland
Top achievements
Rank 1
Peter
Telerik team
Share this question
or