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

Is it timezone error in scheduler?

5 Answers 515 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Grzegorz
Top achievements
Rank 1
Grzegorz asked on 02 Oct 2013, 03:21 PM
i have kendo scheduler configured as follows:
@(Html.Kendo().Scheduler<Dansinn.Models.Event>()
    .Name("scheduler")
    .Height(600)
    .Messages(messages =>
    {
        messages.Save(LocalizationResources.OK);
        messages.Cancel(LocalizationResources.Cancel);
    })
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.AgendaView();
    })
    .Timezone("Etc/UTC")
    .Editable(editable => editable.TemplateName("Event").Resize(false))
    .DataSource(builder =>
    {
        builder.Events(events =>
        {
            events.Error("bs.kendo.scheduler.onError");
            events.RequestEnd("bs.kendo.onRequestEnd");
        });
        builder.Create(operationBuilder => operationBuilder.Action<ScheduleController>(controller => controller.Create(null)));
        builder.Update(operationBuilder => operationBuilder.Action<ScheduleController>(controller => controller.Update(null)));
        builder.Destroy(operationBuilder => operationBuilder.Action<ScheduleController>(controller => controller.Remove(null)));
        builder.Read(operationBuilder => operationBuilder.Action<ScheduleController>(controller => controller.Get(null)));
        builder.Model(factory =>
        {
            factory.Id(model => model.Id);
            factory.Field(model => model.Type);
            factory.Field(model => model.Start);
            factory.Field(model => model.End);
            factory.Field(model => model.Title);
            factory.Field(model => model.RecurrenceRule);
            factory.Field(model => model.RecurrenceException);
            factory.Field(model => model.Description);
            factory.Field(model => model.IsAllDay);
        });
    }))
In my computer I have currently timezone UTC+2. When I adding a new event and set start date to 17:10 (5:10 PM) it is send to server as 19:10 (7:10 PM). I think that scheduler should send to server 15:10 value (3:10 PM). Is it bug in scheduler or in my understanding?

5 Answers, 1 is accepted

Sort by
0
Grzegorz
Top achievements
Rank 1
answered on 03 Oct 2013, 07:08 AM
I have a second question also. I found out that scheduler always gets and displays events in regard to the client system timezone.
The timezone property of the scheduler indicates in which timezone are stored events on server (am I correct?). There is no property to set client timezone.
Is there a way to specify client timezone and override the default behavior?

Example scenario:
There is a store in Australia that is open from 8 to 16. "Opening hours" is an event in scheduler.
Manager of the store is on a business trip to US (he changed timezone to US timezone).
Now when he wants to change the store opening hours he must consider the diferent timezone offset.
In our application we want to set fixed timezone on the client, based on the manager's store, which is in Australia.

Our desired behavior would be to have an option to set client timezone. If it isn't set, it could get it from the client system (trough javascript).
Is this possible in current implementation?
0
Vladimir Iliev
Telerik team
answered on 03 Oct 2013, 10:11 AM
Hi,

 
I would suggest to download the latest internal build (you can open a new support ticket and ask for it) of KendoUI Scheduler where the dates are send to the server with the correct format allowing correct binding on the server side.

Also when the Scheduler timeZone is set to "UTC" (using the "Timezone" method) then the events should be displayed in the specified timeZone (I would suggest to check this functionality after upgrading to the latest internal build).

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
Grzegorz
Top achievements
Rank 1
answered on 03 Oct 2013, 11:48 AM
The version we're using is v2013.2.918.
Scheduler is sending events in UTC (it is autoconverting from local client timezone) (after setting it trough the TimeZone property). OK
Server is sending dates in UTC also (UTC stored in database). OK
Scheduler after receiving event converts them to the client timezone. OK

Two problems we're experiencing:
  1. We want to set client timezone. We don't want the scheduler to get the client timezone (probably by javascript).
  2. We think that the timezone conversion is wrong. It doesn't show up, when events are added trough scheduler, but it shows up when events are added externally (directly to database). I attached a diagram with explanation of the problem.

Please provide feedback for the 2 points mentioned here. Thank you.


0
Vladimir Iliev
Telerik team
answered on 07 Oct 2013, 09:46 AM
Hi Grzegorz,

 
I'm little confused to the last answer as I already mention that the issue you are referring to is already fixed in the latest internal builds (after your current version of KendoUI). I would suggest to download and install the latest internal build (you can get it by requesting it in a new support ticket) and open a new forum post or support thread if you have additional questions. 

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
Accepted
Grzegorz
Top achievements
Rank 1
answered on 10 Oct 2013, 12:21 PM
Hello,

First of all thank you for your help.
We did as you advised and got our hands on the latest internal build.
We found out that scheduler changed datetime format to ISO and started to convert times properly =].
We found also that we had a bug, because our dates read from database had DateTime.Kind set always to unspecified and this resulted in bad serialization to json: "2013-10-02T17:25:47" (should be "Z" at the end to specify the UTC zone).
Now we are always setting the DateTime.Kind to UTC and everything works just fine; scheduler gets date as UTC: "2013-10-02T17:25:47Z"

Thank you once again, now everything works as expected.

EDIT: To treat and serialize datetimes from db as UTC you can set (Global.asax in MVC project) GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc;
Tags
Scheduler
Asked by
Grzegorz
Top achievements
Rank 1
Answers by
Grzegorz
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Share this question
or