I am using the scheduler with ASP.NET MVC. I set the timezone value to "Est/UTC" yet the start and end DateTime values are always using "Utc" as the "Kind". I have also tried by NOT setting the timezone value. I have been looking through these posts for the past couple of hours and found nothing that works. I want the DateTime values that get passed back through the controller to tell me the correct local time for that user or the correct "adjusted" value in UTC. To repeat, I am getting the correct local time but reported as UTC. That means a 5pm event gets saved as a noon event for someone in EST.
Is there some setting I am missing? This seems like it should be obvious but I am stuck.
in controller.cs
in view.cshtml
Is there some setting I am missing? This seems like it should be obvious but I am stuck.
in controller.cs
public
ActionResult Schedule()
{
var now = DateTime.Now;
ViewBag.StartTime =
new
DateTime(now.Year, now.Month, now.Day, 7, 0, 0, DateTimeKind.Local);
ViewBag.TimeZone =
"Etc/UTC"
;
return
View();
}
in view.cshtml
@(Html.Kendo().Scheduler<
Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel
>()
.Name("scheduler")
.Date(DateTime.Now)
.StartTime((DateTime)ViewBag.StartTime)
.Timezone((string)ViewBag.TimeZone)
.AllDaySlot(false)
.Editable(e =>
{
e.Create(true);
e.Destroy(true);
e.Update(true);
})
.Height(590)
.Views(views =>
{
views.DayView();
views.WeekView(v => v.Selected(true));
views.MonthView();
views.AgendaView();
})
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.TaskID);
m.Field(f => f.TaskID);
m.Field(f => f.Title);
m.Field(f => f.ProviderId);
m.Field(f => f.Start);
m.Field(f => f.StartTimezone);
m.Field(f => f.EndTimezone);
m.Field(f => f.Description);
m.Field(f => f.RecurrenceID);
m.Field(f => f.RecurrenceRule);
m.Field(f => f.RecurrenceException);
m.Field(f => f.OwnerID);
m.Field(f => f.IsAllDay);
})
.Read(read => read.Action("Read", "Scheduler").Data("additionalData"))
.Create(create => create.Action("Create", "Scheduler").Data("additionalData"))
.Update(update => update.Action("Update", "Scheduler"))
.Destroy(destroy => destroy.Action("Destroy", "Scheduler"))
.ServerOperation(true)
)
)