Multiple days event

8 posts, 0 answers
  1. Andre Beauchamp
    Andre Beauchamp avatar
    14 posts
    Member since:
    Jan 2004

    Posted 17 Aug 2015 Link to this post

    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)

  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2206 posts

    Posted 19 Aug 2015 Link to this post

    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!
     
  3. Kyle
    Kyle avatar
    7 posts
    Member since:
    Feb 2016

    Posted 01 Apr 2016 in reply to Vladimir Iliev Link to this post

    Is there anyway to increase that "24 hour" threshold before rendering something as an all-day event?
  4. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2206 posts

    Posted 04 Apr 2016 Link to this post

    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!
     
  5. Jonathan
    Jonathan avatar
    12 posts
    Member since:
    Oct 2018

    Posted 19 Dec 2020 in reply to Andre Beauchamp Link to this post

    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

  6. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1241 posts

    Posted 22 Dec 2020 Link to this post

    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/.

  7. Jonathan
    Jonathan avatar
    12 posts
    Member since:
    Oct 2018

    Posted 22 Dec 2020 in reply to Veselin Tsvetanov Link to this post

    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.
  8. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1241 posts

    Posted 23 Dec 2020 Link to this post

    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/.

Back to Top