How to create timeline month and timeline week view (TimelineView customization)

1 Answer 64 Views
Scheduler
Radek
Top achievements
Rank 1
Radek asked on 15 Mar 2023, 02:56 PM

Hi, 

I would like to have timeline month and timeline week views in React Scheduler (same as in jQuery Scheduler). What is the correct way to do it?

I tried setting numberOfDays prop to 7 and 30, but the problem with this approach is that the views start with current date and not with the beginning of the current week/month. I noticed there is also dateRange prop, but I cannot figure out what exactly to pass to it. 

Thanks

Radek

1 Answer, 1 is accepted

Sort by
0
Accepted
Wissam
Telerik team
answered on 17 Mar 2023, 02:45 PM

Hi, Radek,

Since the TimeLineView displays the selected date as the first day, you can get the selected date, find the Date value of Monday or the first day of the month depending on it, and set it to the date value.

In the below example, I am rendering a DropDownList that allows you to either select the Week or Month view mode. In its `onChange` handler, I am setting the `numberOfDays` state variable that is passed to the numberOfDays prop, and I am setting the `timeLineView` state variable.

In addition, I am getting the selected date in the Scheduler's onDateChange event handler and passing it to either the `getMonday` or `getFirstDayOfMonth` function depending on the value of `timeLineView`. In the function, I am setting the new date and passing it to the component.

The only drawback to this workaround is that the DatePicker will show the first day of the week/month and not the selected date.

If you prefer having TimeLineMonthView and TimeLineWeekView components, you can submit a feature request in our feedback portal where new ideas are constantly being evaluated and the most popular ones are implemented in future releases:

I hope this helps, but please let me know if you have any further questions.

Regards,
Wissam
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Radek
Top achievements
Rank 1
commented on 20 Mar 2023, 08:09 AM

This will do.

Thank you

Wissam
Telerik team
commented on 20 Mar 2023, 12:06 PM

You are welcome, Radek! I am glad that my reply was helpful to you.
Tags
Scheduler
Asked by
Radek
Top achievements
Rank 1
Answers by
Wissam
Telerik team
Share this question
or