Goodday,
I am having issues reconciling the difference btw the date on my schedule control and the one saved in my Db.Though the Date rendered from the Db back to the schedule control is rendered correctly, I can't understand the almost + 6hrs difference in the StartTime and Endtime from the Schedule Control and what was saved in the Db even though my Timezone is UTC +01:00.
I took my time to use fiddler to investigate and I saw the following.
Note: I used the EndTime (Time only) as Subject.
The EndTime sent from the schedule is EndTime=2017-07-23T08:00:00.000Z and what was return as result after saving to Schedule and Db was EndTime=2017-07-23T09:00:00+01:00 but what was saved in the Db (MSSQL) is 2017-07-23 13:15:00.000 and what was returned from my web query (MVC) is "2017-07-23T09:00:00".
The actual expected EndTime 9:00 AM of 23rd of July. I don't understand why the DB time is saved as 15:00 (+6hrs). I need to understand what is the cause.
Also attached are images of the data for better understanding.
My schedule was created thus :
@(Html.EJ().Schedule("routeSchedule")
.Width("100%")
.Height("525px")
// .CellWidth("50px")
.CurrentDate(DateTime.Now)
//.Orientation(Orientation.Horizontal)
.Resources(res =>
{
res.Field("TerritoryId").Title("Territory").Name("Territories").AllowMultiple(true).ResourceSettings(fld => fld.Datasource(initialTerrittory)
.Text("Text").Id("Id")).Add();
res.Field("RouteId").Title("Route").Name("Routes").AllowMultiple(true).ResourceSettings(flds => flds.Datasource(initialTerritoryRoutes)
.Text("Text").Id("Id").GroupId("GroupId").Color("Color")).Add();
})
.Group(gr => gr.Resources(Group))
.ShowLocationField(true)
.CategorizeSettings(cat => cat.Enable(true))
//.PrioritySettings(pri => pri.Enable(true))
.ShowCurrentTimeIndicator(true)
.Views(view)
.CurrentView(CurrentView.Month)
.AppointmentSettings(fields => fields.Datasource(ds => ds.URL(@Url.Action("GetCompanyScheduledRoutes", "Route", new { companyid = Model.Id, routeid = firstroute, territoryid = firstterritory })).InsertURL(Url.Action("AddScheduledRoutes", "Route", new { companyid = Model.Id }))
.BatchURL(@Url.Action("Crud", "Route")).Adaptor(AdaptorType.UrlAdaptor))
.Id("Id")
.Subject("Subject")
.StartTime("StartTime")
.EndTime("EndTime")
.StartTimeZone("StartTimeZone")
.EndTimeZone("EndTimeZone")
.Description("Comments")
.AllDay("AllDay")
.Recurrence("Recurrence")
.RecurrenceRule("RecurrenceRule")
.RecurrenceId("RecurrenceId")
.RecurrenceExDate("RecurrenceExDate")
.Location("Location")
.ResourceFields("TerritoryId, RouteId"))
.ScheduleClientSideEvents(eve => eve.Navigation("OnNavigation").CellClick("OnCellClick").AppointmentWindowOpen("onAppointmentWindowOpen"))
/*.AppointmentTemplateId("#MyTemplate")*/)
Fiddler View
Schedule Control View
Web View
Database View
Thanks alot, sorted it out. Its an issue with my app, somewhere @the initialization of my app, a wrong time-zone was set as default.