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

4 posts, 0 answers
  1. Tim Fargo
    Tim Fargo avatar
    12 posts
    Member since:
    Sep 2008

    Posted 04 Jan Link to this post

    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.

  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 06 Jan Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Tim Fargo
    Tim Fargo avatar
    12 posts
    Member since:
    Sep 2008

    Posted 06 Jan Link to this post

    Your first link appears to be broken.

  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 07 Jan Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready