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

Problem with Timezones

1 Answer 316 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Steve Mason
Top achievements
Rank 1
Steve Mason asked on 10 Nov 2015, 12:17 AM

The PC I'm working on is set to Pacific timezone (America/Los_Angeles). I'm creating a Scheduler in Eastern timezone (America/New_York) and I have a change event setup where I output the value of e.start. If, for example, I click on a 1pm timeslot, I would expect the change event to output 1pm eastern time. It's not, it's outputting 1pm Pacific time. Am I missing something?

Thanks

Here's a small example based on one of the Kendo demos that shows the problem:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Kendo UI Snippet</title>
 
 
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
<body>
   
<div id="scheduler"></div>
<script>
$("#scheduler").kendoScheduler({
    date: new Date("2013/6/13"),
    timezone: "America/New_York",
    selectable: true,
    change: function (e) {
      console.log(e.start);
    },
    dataSource: {
        batch: true,
        transport: {
            read: {
                url: "http://demos.telerik.com/kendo-ui/service/tasks",
                dataType: "jsonp"
            },
            update: {
                url: "http://demos.telerik.com/kendo-ui/service/tasks/update",
                dataType: "jsonp"
            },
            create: {
                url: "http://demos.telerik.com/kendo-ui/service/tasks/create",
                dataType: "jsonp"
            },
            destroy: {
                url: "http://demos.telerik.com/kendo-ui/service/tasks/destroy",
                dataType: "jsonp"
            },
            parameterMap: function(options, operation) {
                if (operation !== "read" && options.models) {
                    return {models: kendo.stringify(options.models)};
                }
            }
        },
        schema: {
            model: {
                id: "ID",
                fields: {
                    ID: { type: "number" },
                    title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                    start: { type: "date", from: "Start" },
                    end: { type: "date", from: "End" },
                    description: { from: "Description" },
                    recurrenceId: { from: "RecurrenceID" },
                    recurrenceRule: { from: "RecurrenceRule" },
                    recurrenceException: { from: "RecurrenceException" },
                    ownerId: { from: "OwnerID", defaultValue: 1 },
                    isAllDay: { type: "boolean", from: "IsAllDay" }
                }
            }
        }
    }
});
</script>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 11 Nov 2015, 10:17 AM
Hi Steve,

I would suggest to check the following help article which contains more information about how the dates on the client side behaves:

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