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

Have timeline always display days starting with a Monday

14 Answers 132 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 06 Mar 2012, 03:22 AM
I'm looking to have the Scheduler display the current week on the timeline, but by default the first column will be today(which 6/7 times isn't Monday). Also when people select a date on the calendar that day is the start of the 7 columns shown by the timeline, rather than the Monday that starts that week.
Is there any way to ensure the Monday is always in the first column regardless of the current day or what is selected from navigation via the calendar?
Also, is there any way to make the calendar start on a Monday?
Thanks,
Edward

14 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 06 Mar 2012, 01:57 PM
Hello Edward,

Please, see this demo which shows how to customize the Multi-day view to always start and end with a specific day of the week.

protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
       {
           if (RadScheduler1.SelectedView == SchedulerViewType.TimelineView)
           {
               TimelineConfigPanel.Visible = true;
               MultidayConfigPanel.Visible = false;
           }
           else if (RadScheduler1.SelectedView == SchedulerViewType.MultiDayView)
           {
 
               RadScheduler1.MultiDayView.NumberOfDays = int.Parse(NumberOfDaysList.SelectedValue);
               RadScheduler1.FirstDayOfWeek = (DayOfWeek)int.Parse(FirstDayOfWorkWeekList.SelectedValue);
 
               //SelectedDate adjustment to make a Work Week view from Multi-day view
               int WorkWeekAdjustmentTimeShift = (int)RadScheduler1.FirstDayOfWeek - (int)RadScheduler1.SelectedDate.DayOfWeek;
               if (e.Command == SchedulerNavigationCommand.NavigateToNextPeriod)
               {
                   if (WorkWeekAdjustmentTimeShift < 0)
                       WorkWeekAdjustmentTimeShift += 7;
 
               }
               else if (e.Command == SchedulerNavigationCommand.NavigateToPreviousPeriod)
               {
                   if (WorkWeekAdjustmentTimeShift > 0)
                       WorkWeekAdjustmentTimeShift -= 7;
               }
               RadScheduler1.SelectedDate = RadScheduler1.SelectedDate.AddDays(WorkWeekAdjustmentTimeShift);
 
 
               TimelineConfigPanel.Visible = false;
               MultidayConfigPanel.Visible = true;
           }
       }
   }

The same approach can be used for Timeline view as well.


Kind regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Peter
Telerik team
answered on 06 Mar 2012, 01:59 PM

I just noticed you had another question about the popup navigatio calendar. Yes, you can access it in RadScheduler's PreRender event and set its properties as per your requirement.

Greetings,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
sandhya
Top achievements
Rank 1
answered on 15 Sep 2016, 12:22 PM

Hello,

Can any one please let me know how to set "Monday" as start day always in Timeline view of Rad Scheduler like when we change the date from the calendar(Suppose I select Wednesday),it is showing "Wednesday" as Start Day .But we need to highlight the selected day,showing start day as "Monday" from the select day week.Please help..

0
Anton
Telerik team
answered on 19 Sep 2016, 06:32 AM
Hello,

A way of having always "Monday" as start day in Timeline view is as in the following example: 
<script>
            var schedulerView;
 
            $(function () {
                var scheduler = $find("<%= RadScheduler1.ClientID %>");
 
                schedulerView = scheduler.get_selectedView();
 
                //If Selected View is Timeline
                if (schedulerView === 4) {
                    setFirstDayMonday(scheduler)
                }
            });
 
            function onNavigationComplete(sender, args) {
                schedulerView = sender.get_selectedView();
 
                //Check if selected view is either Day, Week or Month, cause it is also considered as "navigation" when switching among views
                if (schedulerView === 0 || schedulerView == 1 || schedulerView === 2) {
                    return;
                }
 
                setFirstDayMonday(sender);
            }
 
            function setFirstDayMonday(scheduler) {
                var date = scheduler.get_selectedDate(),
                    currentDate = date.getDate(),
                    weekDayNumber = date.getDay();
 
                date.setDate(currentDate - weekDayNumber + 1);
            }
        </script>

However, RadScheduler does not have certain functionality to highlight selected day in neither View. You have to add it yourself as a custom feature. Doing some calculations with the weekDayNumber value from the code snippet above and also the count the slots in Timeline View you can apply some CSS to the selected date.
 

Regards,
Anton
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
sandhya
Top achievements
Rank 1
answered on 19 Sep 2016, 01:23 PM

Thanks a lot for replying Anton,given code is executing with out any errors but the selected date week's "Monday" is not setting as starting day.Is there any other default settings that is overriding the selection.Below is our rad scheduler events. 

 <telerik:RadScheduler ID="radscheduler1" runat="server" OnResourcesPopulating="myEBCSchedule_OnResourcesPopulating"
        OnClientAppointmentEditing="OnClientAppointmentEditing" OnClientAppointmentContextMenu="OnClientAppointmentContextMenu"
        OnClientAppointmentClick="OnClientAppointmentClick" OnClientAppointmentDeleting="OnClientAppointmentDeleting"
        OnClientFormCreated="OnClientFormCreated" OnClientAppointmentResizeStart="OnClientAppointmentResizeStart"
        OnClientAppointmentMoveEnd="OnClientAppointmentMoveEnd" OnClientAppointmentsPopulating="OnClientAppointmentsPopulating"
        OnClientAppointmentsPopulated="OnClientAppointmentsPopulated" OnClientAppointmentContextMenuItemClicked="OnClientAppointmentContextMenuItemClicked">
        <TimelineView UserSelectable="true" ShowInsertArea="false" TimeLabelSpan="1" NumberOfSlots="7"
            GroupBy="BRRoom" GroupingDirection="Vertical" ColumnHeaderDateFormat="dddd MM/dd"
            ShowResourceHeaders="true" ShowDateHeaders="true" />

 

Please help.

 

Regards,

Sandhya.

0
Anton
Telerik team
answered on 20 Sep 2016, 08:42 AM
Hi,

Could you please check on the attached sample project and see if it is working at your side.

Regards,
Anton
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
sandhya
Top achievements
Rank 1
answered on 21 Sep 2016, 10:09 AM

Thanks a ton Anton's . Attached code helped a lot. we dint added RadAjaxManager .After adding,its working fine.

Thank you once again!!

 

Regards,

Sandhya.

0
sandhya
Top achievements
Rank 1
answered on 18 Oct 2016, 07:15 AM

Hi Support,

We have a column in kendo grid which is having capital letters too in its data.While sorting ,it is ignoring the case and sorting like below.

AFSO CC
AT Kenny
Advertisement

But we want it to be sorted like below.

Advertisement
AFSO CC
 AT Kenny

Please help!!Posting here as I am unable to create a new thread.Please Help..

Regards,
Sandhya.

0
sandhya
Top achievements
Rank 1
answered on 03 Nov 2016, 09:33 AM

Hi Anton,

When we are setting the start day as Monday,its working fine but the appointments are not binding to the days.when we select Wednesday from the calendar,Monday ,Tuesday appointments are not binding.If again select t he same week Monday,it is showing all the appointments.

Please help!!

0
sandhya
Top achievements
Rank 1
answered on 03 Nov 2016, 09:43 AM
Hi Anton,
When we are setting the start day as Monday,its working fine but the appointments are not binding to the days.when we select Wednesday from the calendar,Monday ,Tuesday appointments are not binding.If again select t he same week Monday,it is showing all the appointments.
Please help!!
0
Manju
Top achievements
Rank 1
answered on 07 Nov 2016, 09:05 AM

Hi Anton,

Could you please help us with the above issue. We are able to default the calendar view start date to Monday but unable to load the appointments. Ex. When Wednesday is selected from the timeline view, the scheduler start date is set to Monday but the appointments are loading from Wednesday. Appointments for Monday and Tuesday does not load.

Regards,
Manju.

0
Anton
Telerik team
answered on 07 Nov 2016, 11:04 AM
Hello,

Are you talking about the project provided in this forum post? If that's correct, could you please provide a video showing the false behavior?

Regards,
Anton
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Manju
Top achievements
Rank 1
answered on 08 Nov 2016, 07:54 AM

Hi Anton,

The code that u had attached did not have appointments in it. So we did not see this issue.

But our code which has appointments has this problem.

Can you please send us code with appointments in it? so that we can try and add it to our code.

Regards,
Manju

0
Anton
Telerik team
answered on 08 Nov 2016, 09:55 AM
Hello Manju,

The attached project I was asking about has 3 appointments but I'm attaching you another one with more appointments and working at my side as you can see on the video. The appointments are bound correctly having Monday as start day in TimeLine view.

Before running the project please add reference to Telerik.Web.UI.dll and Telerik.Web.UI.Skins.dll.

Regards,
Anton
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Scheduler
Asked by
Edward
Top achievements
Rank 1
Answers by
Peter
Telerik team
sandhya
Top achievements
Rank 1
Anton
Telerik team
sandhya
Top achievements
Rank 1
Manju
Top achievements
Rank 1
Share this question
or