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

Starttime & endtime

5 Answers 219 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
OfficeHeart
Top achievements
Rank 1
OfficeHeart asked on 19 Jul 2013, 11:18 AM
Hi,

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

Thanks,
Martin

5 Answers, 1 is accepted

Sort by
0
Accepted
Ian
Top achievements
Rank 1
answered on 22 Jul 2013, 04:49 PM
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

0
Vladimir Iliev
Telerik team
answered on 23 Jul 2013, 09:20 AM
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!
0
Ian
Top achievements
Rank 1
answered on 23 Jul 2013, 09:41 AM
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
0
Kjeld
Top achievements
Rank 1
answered on 03 Jan 2014, 11:57 AM
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

0
Vladimir Iliev
Telerik team
answered on 06 Jan 2014, 10:32 AM
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!
Tags
Scheduler
Asked by
OfficeHeart
Top achievements
Rank 1
Answers by
Ian
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Kjeld
Top achievements
Rank 1
Share this question
or