Starttime & endtime

6 posts, 1 answers
  1. OfficeHeart
    OfficeHeart avatar
    99 posts
    Member since:
    Aug 2008

    Posted 19 Jul 2013 Link to this post

    Hi,

    How can I get the starttime and endtime from the scheduler in the datebinding event?

    Thanks,
    Martin
  2. Answer
    Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 22 Jul 2013 Link to this post

    Hi Martin,
    Is this what you're looking for:

    function initCalendar(assignments) {
      $("#scheduler").kendoScheduler({
        date: new Date(),
        views: [
           { type: "day", selected: true },
          { type: "week" },
          { type: "month" }
        ], 
       allDaySlot: true,
        dataSource: assignments,
        dataBinding: function (e) {
          console.log('Start:' + this.view().startDate());
          console.log('End:' + this.view().endDate());
        }
      });
    }

    It seems to work for day and week views but the end date for month views doesn't seem quite right. Maybe be a beta release bug?

    Best regards, Ian

  3. Kendo UI is VS 2017 Ready
  4. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 23 Jul 2013 Link to this post

    Hi Ian,

     
    Thank you for the provided example. 

    I tried to reproduce the issue with the start and end time of the "month" view but to no avail - everything is working as expected on our side. For convenience I created small jsBin example based on the provided example - could you please check it and let me know how it differs from your real setup?


    Kind 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. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 23 Jul 2013 Link to this post

    Hi Vladimir,
    Sorry, it was my mistake. I was testing the scheduler Month view for July and couldn't understand why it was returning an end date of Aug 10th. I then realized it's because in Month view you always show six rows (weeks) of data and that's why the end date was ten days after the actual end of the month. 

    Thanks for the example and quick reply.
    Bets regards,
    Ian
  6. Kjeld
    Kjeld  avatar
    3 posts
    Member since:
    Mar 2013

    Posted 03 Jan 2014 Link to this post

    Hello,

    Just wondering:
    The existence of view().startDate() helped me a lot in my project.

    But I had to search the fora to find it. Am I missing something in the documentation?

    Regards,

    Kjeld

  7. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 06 Jan 2014 Link to this post

    Hi Kjeld,

    Thank you for bringing that missing documentation to our attention - we will add the method to the scheduler API to the end of the week.

    Kind Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready