Kendo scheduler change start time when the date changes in navigation bar

2 posts, 0 answers
  1. Shajina
    Shajina avatar
    2 posts
    Member since:
    Dec 2015

    Posted 04 May 2017 Link to this post

    Hello,

    I am using kendo scheduler in my project.  I am using time line view and we have a requirement where I have to set the start time of the scheduler as 12:00 PM on page load.  When I navigate to the next date the time line should start from 12:00AM again and not 12:00PM. Currently once I set the start time, all other days also start with the same start time.

    Kindly suggest how can I achieve the same.



    Thanks & Regards

    Shajina

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1209 posts

    Posted 09 May 2017 Link to this post

    Hello Shajina,

    To achieve the desired dynamic change of the startTime of the Scheduler, you will need to destroy the widget and recreate it with the desired options. You could implement that logic in its navigate event:
    navigate: function(e) {
      var scheduler = e.sender;
      var startTime = scheduler.options.startTime;
       
      if (startTime.getHours() === 12) {
        e.preventDefault();
         
        var options = scheduler.options;
        scheduler.destroy();
        options.startTime = new Date("2013/6/13 12:00 AM");
        options.date = e.date;
        $("#scheduler").empty().kendoScheduler(options);
      }
    },

    Here you will find a small Dojo sample, implementing the above.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top