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

Problem editing events with timezones

5 Answers 242 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael Hilgers
Top achievements
Rank 1
Michael Hilgers asked on 27 May 2014, 01:15 PM
Hey everyone,

i'm facing a problem with the scheduler. I've made a sample with two events, one in timezone "Europe/Berlin" and one in "America/Los Angeles". Both events are starting at 09:00 AM and end at 12:00 AM on 28.05.2014. Both are shown correctly in the scheduler overview (the LA event -9 hours prior to the Berlin event which is correct).

But when I open the LA event for editing, the time gets messed up (9 hours are substracted from the start and end time which moves the event to 27.05.2014). Editing the Berlin event shows the correct time in the edit dialog.

My local timezone is Europe/Berlin and i'm using KendoUI Q1 2014.

Here's the example code which reproduces the problem for me:

<div id="scheduler"></div>
 
    <script src="javaSources/js/jquery.min.js"></script>
    <script src="javaSources/js/kendo.all.js"></script>
    <script src="javaSources/js/kendo.timezones.js"></script>
    <script src="javasources/js/cultures/kendo.culture.de-DE.js"></script>
    <script type="text/javascript">
        kendo.culture("de-DE");
    </script>
 
    <script>
        $(function () {
            "use strict";
 
            var dsScheduler = new kendo.data.SchedulerDataSource({
                data: [
                    { "Description": "", "End": "\/Date(1401271200000)\/", "IsAllDay": false, "PublicEvent": false, "Start": "\/Date(1401260400000)\/", "StartTimezone": "Europe\/Berlin", "TaskId": 30, "Title": "No title" },
                    { "Description": "", "End": "\/Date(1401271200000)\/", "IsAllDay": false, "PublicEvent": false, "Start": "\/Date(1401260400000)\/", "StartTimezone": "America\/Los_Angeles", "TaskId": 32, "Title": "No title" }
                ],
                schema: {
                    //timezone: "Europe/Berlin", // nicht setzen, damit Termin aus verschiedenen Zeitzonen auch korrekt angezeigt werden!!
                    model: {
                        id: "taskId",
                        fields: {
                            taskId: { from: "TaskID", type: "number", defaultValue: -1 },
                            title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                            start: { type: "date", from: "Start" },
                            end: { type: "date", from: "End" },
                            startTimezone: { from: "StartTimezone", defaultValue: "Europe/Berlin" },
                            endTimezone: { from: "EndTimezone" },
                            description: { from: "Description" },
                            recurrenceId: { from: "RecurrenceID" },
                            recurrenceRule: { from: "RecurrenceRule" },
                            recurrenceException: { from: "RecurrenceException" },
                            isAllDay: { type: "boolean", from: "IsAllDay", defaultValue: false }
                        }
                    }
                }
            });
 
            var kScheduler = new kendo.ui.Scheduler($("#scheduler"), {
                dataSource: dsScheduler,
                //timezone: "Europe/Berlin", // nicht setzen, damit Termin aus verschiedenen Zeitzonen auch korrekt angezeigt werden!!
                height: 500,
                views: [
                    "day",
                    "week",
                    { type: "month", selected: true },
                    "agenda"
                ]
            });
 
        });
    </script>

Any ideas whats wrong?

Regards,
Michael

5 Answers, 1 is accepted

Sort by
0
Michael Hilgers
Top achievements
Rank 1
answered on 27 May 2014, 01:31 PM
I think i got it ....

Changing the timezone while creating a new event doesn't mean the time is interpreted as 9 AM in LA, but still as 9 AM in Berlin .... right?

Isn't this a little bit confusing for the user? E.g. I have to create a event for a meeting in a different country, it should start at 9 AM. Do I really have to calculate the time offset to be able to select the correct start time? Wouldn't it be nice just to say "hey, let's start at 9 AM Pacific Time" and thats it?

Regards,
Michael
0
Michael Hilgers
Top achievements
Rank 1
answered on 27 May 2014, 01:37 PM
And on every edit, you move the LA event -9 hours back in time .... that's not good ...

Why can't posts here in the forum be edited any more? So we have to spam our own threads ....
0
Vladimir Iliev
Telerik team
answered on 29 May 2014, 10:46 AM
Hi Michael,


Thank you for bringing this behavior to our attention. I have informed our dev team about it and they will investigate further if it's correct and if it should be improved. When I have more information about it I will follow you up in current thread. 

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
David
Top achievements
Rank 1
answered on 02 Sep 2016, 06:49 PM

Was this ever addressed or resolved?  I believe I'm still seeing this behavior in new versions (Telerik.UI.for.AspNet.Core 2016.2.714) when setting an event in a different timezone than what the calendar is using for display. 

For example:
1. Set the calendar's timezone to "America/Chicago", aka (GMT-0:600) Central Time (US & Canada)"
2. Create a new event and specify timezone "(GMT-0:800) Pacific Time (US & Canada)" for both start and end time.  Save the new event.
3. Note that the event properly converts the time and displays the event in Central Time.
4. Edit the event.  Note the timezone shows "America/Log_Angeles", but Start and End time reflect the time that is displayed on the calendar in Central Time. 
5. Saving the event without adjusting the time applies the conversion from PT to CT again.

0
Vladimir Iliev
Telerik team
answered on 07 Sep 2016, 07:21 AM
Hi David,

I tried to reproduce the described behavior on our side but to no avail - everything is working as expected (demo here). This leads me to believe that the reason for the described behavior is that the server is not handling the timezones of the events correctly. For more information on how to setup your project correctly I would suggest to check the following help article:


Regards,
Vladimir Iliev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Scheduler
Asked by
Michael Hilgers
Top achievements
Rank 1
Answers by
Michael Hilgers
Top achievements
Rank 1
Vladimir Iliev
Telerik team
David
Top achievements
Rank 1
Share this question
or