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

Different WorkDayStartTime and WorkDayEndTime on each day

5 Answers 247 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mickey
Top achievements
Rank 1
Mickey asked on 09 Jun 2009, 12:33 PM
Hi,
I need to define different WorkDayStartTime and WorkDayEndTime on different days
Example:
Sunday 10:00 - 17:00
Monday 12:00-18:00
and so on...

Can this be done?
if yes, how?
Regards,
Mickey

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 10 Jun 2009, 10:56 AM
Hello Mickey,

Setting WorkDayStartTime and WorkDayEndTime causes RadScheduler to apply the rsNonWorkHour class to days that do not fall in the specified range. You can test this behavior in this demo:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/customization/defaultcs.aspx

However, the DayStartTime and DayEndTime properties can be set easily in NavigationComplete:
protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)  
    {  
        DayOfWeek currentDay = RadScheduler1.SelectedDate.DayOfWeek;  
        switch (currentDay)  
        {  
            case DayOfWeek.Monday:  
                RadScheduler1.DayStartTime = new TimeSpan(8, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(17, 0, 0);  
                break;  
            case DayOfWeek.Tuesday:  
                RadScheduler1.DayStartTime = new TimeSpan(10, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(18, 0, 0);  
                break;  
            case DayOfWeek.Wednesday:  
                RadScheduler1.DayStartTime = new TimeSpan(10, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(19, 0, 0);  
                break;  
            case DayOfWeek.Thursday:  
                RadScheduler1.DayStartTime = new TimeSpan(9, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(14, 0, 0);  
                break;  
            case DayOfWeek.Friday:  
                RadScheduler1.DayStartTime = new TimeSpan(11, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(17, 0, 0);  
                break;  
            case DayOfWeek.Saturday:  
                RadScheduler1.DayStartTime = new TimeSpan(13, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(16, 0, 0);  
                break;  
            case DayOfWeek.Sunday:  
                RadScheduler1.DayStartTime = new TimeSpan(13, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(16, 0, 0);  
                break;  
            default:  
                RadScheduler1.DayStartTime = new TimeSpan(8, 0, 0);  
                RadScheduler1.DayEndTime = new TimeSpan(17, 0, 0);  
                break;  
        }  
    } 

However, NavigationComplete occurs too late in the page  life cycle to allow you to se WorkDayStartTime and WorkDayEndTime properties. Let us know if the other pair of properties (DayStartTime and DayEndTime) cannot be a substitute and we will try to find a plausible workaround.


All the best,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mickey
Top achievements
Rank 1
answered on 10 Jun 2009, 11:54 AM
Thanks for your replay,
But this is not what I wanted,

I would like to see in a week view the working hours distinguished from the off working hours,
But I would like to have a different working hour for each day
assuming I have a holiday during the week which the working hours are 9-12 but the rest off the week 8-17 or
some some day I manage a morning shift and on the other an evening shift.

Regards,
Mickey
0
Peter
Telerik team
answered on 10 Jun 2009, 02:58 PM
Hello Mickey,

If you need this functionality for week view, then the way to achieve it is to set the CssClass property of the TimeSlot object in TimeSlotCreated. Please, refer to this kb article for sample code and demo project:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/setting-special-days-or-time-slots-in-radscheduler.aspx



Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mickey
Top achievements
Rank 1
answered on 14 Jun 2009, 07:12 PM
Hi,
I'm setting the DayStartTime/DayEndTime Via code as you have suggested,
But, when I dbl click to create an appointment it open OK,
But when I save it / go to advance options, the app time shift 8 hours ahead,
any idea what I'm doing wrong?
When I do not set those properties everything is OK
Mickey
0
Accepted
Peter
Telerik team
answered on 16 Jun 2009, 04:12 PM
Hello Mickey,

If you can open a support ticket and send us a demo of the problem we might be able to determine why this is happening. In our local test we did not experience such behavior.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Mickey
Top achievements
Rank 1
Answers by
Peter
Telerik team
Mickey
Top achievements
Rank 1
Share this question
or