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

Multiple days event

7 Answers 374 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andre Beauchamp
Top achievements
Rank 1
Andre Beauchamp asked on 17 Aug 2015, 04:35 PM

Hi, if you add an event that starts 08/17/2015 8:00AM and ends at 08/19/2015 : 8h00PM, the scheduler will display the item as if it was an all day event for all three days which is not visually useful.

 I would like to be able to show the event starting at 8h00AM the first day all the way down to the end of the day, then the second day shown as an all day item and finally have the event continue on the last day from 12:00AM to 8h00PM.

Is there a way to achieve this with the scheduler?

 

(I attached some screenshots to better explain my requirements)

7 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 19 Aug 2015, 10:54 AM
Hi,

Basically current behavior is intended in the "day" and "week" views - events longer than 24 hours are rendered as all-day events. That why in current case I would suggest to switch to "timeline" views where all events are rendered as-is. 

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Kyle
Top achievements
Rank 1
answered on 01 Apr 2016, 09:58 PM
Is there anyway to increase that "24 hour" threshold before rendering something as an all-day event?
0
Vladimir Iliev
Telerik team
answered on 04 Apr 2016, 08:19 AM
Hello Kyle,

Please note that this behavior is already supported in timeline views. In day and week views however the same behavior would require creating custom view by extending the existing one and overriding the methods responsible for deciding where given event should be rendered. Currently I could only suggest to check the following demo which shows how to create custom view by extending one of the build-in ones. 

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jonathan
Top achievements
Rank 1
answered on 20 Dec 2020, 03:57 AM

Use an sql query to split the event into multiple events, one for each day.  Then you can alter the times depending on whether the event begins or ends on that day, so it takes up the full day on the schedule as you are trying to accomplish.  This is the code I used in my sql query in order to achieve this.  I know this is an old question, but hopefully it will help someone.

WITH n(n) AS 
(
  SELECT ROW_NUMBER() OVER (ORDER BY [object_id])-1 FROM sys.all_columns
),
d(n,s,e,dd,et) AS 
(
  SELECT n.n, d.StartTime, d.EndTime,
    DATEDIFF(DAY, d.StartTime, d.EndTime),
    DATEADD(DAY, -1, DATEADD(DAY, 1, DATEADD(DAY, n.n, 
      StartTime)))
 FROM n INNER JOIN 
 (
 SELECT      '2020-12-21 12:00:00.000' AS StartTime, 
'2020-12-26 14:00:00.000' AS EndTime 
 ) d 
 ON d.EndTime >= DATEADD(DAY, n.n-1, d.StartTime)
)
SELECT
  new_from_date = CASE n WHEN 0  THEN s ELSE DATEADD(Hour, 8, Convert(datetime, Convert(date, et))) END,
  new_to_date   = CASE n WHEN dd THEN e ELSE DATEADD(Hour, 19, Convert(datetime, Convert(date, et))) END
FROM d WHERE dd >= n

0
Veselin Tsvetanov
Telerik team
answered on 22 Dec 2020, 09:15 AM

Hello Jonathan,

Thank you for your input. I believe other users will also find that approach useful for visually representing longer events in the Scheduler. The only thing that I would like to note is that editing such an event will automatically open the edit pop-up only for that portion of the event that has been clicked.

Regards,
Veselin Tsvetanov
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/.

0
Jonathan
Top achievements
Rank 1
answered on 22 Dec 2020, 01:15 PM
Yes, but I handled this by using the edit event. I use a data field identifying whether it is a multi-day event, and in the edit event it checks this dataitem. If necessary, you can use e.preventDefault to use your own custom editor, or just make a query to the database for the correct times, and update the start and end datetime fields as the editor opens, in the event that it is a multi-day event.
0
Veselin Tsvetanov
Telerik team
answered on 23 Dec 2020, 06:40 AM

Hello Jonathan,

Thank you again. The approach outlined will indeed cover properly the Scheduler editing scenario.

Regards,
Veselin Tsvetanov
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/.

Tags
Scheduler
Asked by
Andre Beauchamp
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Kyle
Top achievements
Rank 1
Jonathan
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Share this question
or