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

Issue with timezone when dragging "Event" from Kendo Grid to Scheduler slot

3 Answers 56 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tim Fargo
Top achievements
Rank 1
Tim Fargo asked on 04 Jan 2016, 11:07 PM

I have a kendo grid with draggable rows, and a kendo scheduler that ondatabound creates a droptargetarea on the current scheduler.view().content.

On drop, I am creating a new Event in the scheduler. The issue, however, is that my scheduler uses a different timezone, so when I retrieve the slot using slot = scheduler.slotByPosition, and then get the start time with slot.startDate it is actually getting a value of that timeslot in my default OS time, rather than the time for that slot in the scheduler timezone. For example, if my scheduler is being displayed in the "Alaska/Anchorage" timezone and I drag the event to the 9am timeslot, it actually gives me a slot.startDate value of 9am in Phoenix (my timezone), so once the event saves it displays in Anchorage time as 7am, since Anchorage is -9 offset and Phoenix is -7.

How can I retrieve the correct startTime using the scheduler timezone? Or is there anyway to leverage the Kendo timezones JS file to convert a time to a different timezone? I don't want to manually calculate anything since timezones are so sensitive to other factors like DST/location.

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 06 Jan 2016, 12:09 PM
Hello Tim,

To get familiar with how the JavaScript Date object is behaving and why you are getting the date offset with your timezone I would suggest to check the following help article:

Also for example of how to utilize the Kendo UI "date" API you can check this code sample which shows how to get start / end time of the view.

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
Tim Fargo
Top achievements
Rank 1
answered on 06 Jan 2016, 04:46 PM

Your first link appears to be broken.

0
Vladimir Iliev
Telerik team
answered on 07 Jan 2016, 08:04 AM
Hi Tim,

Please check the updated link below:

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
Tim Fargo
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Tim Fargo
Top achievements
Rank 1
Share this question
or