Hi all,
I currently have a grid that contains a datetime column that we use to display just the time. When retrieving the time data, we're parsing it with code as follows before the data is being returned to the grid:
var tz = System.TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
schedule.StartTimeDT = System.TimeZoneInfo.ConvertTimeToUtc(DateTime.Parse(schedule.StartTime), tz);
In the grid definition the column is set up as such:
columns.Bound(c => c.StartTimeDT).Title("Start Time").HtmlAttributes(new { style = "text-align: center;" })
When viewed in from a computer that's not in the EST zone, the time value gets automatically changed to whatever the computer timezone is. We got around to forcing it to display EST in the view mode of the grid by modifying the column definition to use a client template:
columns.Bound(c => c.StartTimeDT).Title("Start Time").HtmlAttributes(new { style = "text-align: center;" }).EditorTemplateName("_TimePicker1").ClientTemplate("\\#= moment(data.StartTimeDT).tz('America/New_York').format('HH:mm') \\#");
Which works fine in view mode. But once I click on the edit button to go into the inline edit mode, the time is being changed again. How do I stop this automatic time zone shift when in edit mode?