This question is locked. New answers and comments are not allowed.
I am tackling the UTC issue. We have datetimes in our system that are date only, and they are showing the wrong date based on the timezone.
I am following this info to resolve it:
http://www.telerik.com/community/code-library/aspnet-mvc/grid/grid-using-utc-time-on-both-client-and-server-sides.aspx
This works fine, but I want to make the code a bit more generic. I want to just add a class to the column and then have the code convert any date in that column to UTC.
So I have changed it to this:
But, I need to translate e.dateItem.ChangedAt to the value for the current cell in the each. I'm not quite sure how to do that. Any help is appreciated.
BOb
I am following this info to resolve it:
http://www.telerik.com/community/code-library/aspnet-mvc/grid/grid-using-utc-time-on-both-client-and-server-sides.aspx
This works fine, but I want to make the code a bit more generic. I want to just add a class to the column and then have the code convert any date in that column to UTC.
So I have changed it to this:
function OnRowDataBound(e) { if (!e.dataItem.utc) { e.dataItem.utc = true; $('td.utc', e.row).each(function () { e.dataItem.ChangedAt = toUTC(e.dataItem.ChangedAt); var display = $.telerik.formatString("{0:G}", e.dataItem.ChangedAt); $(this).html(display); }); }}But, I need to translate e.dateItem.ChangedAt to the value for the current cell in the each. I'm not quite sure how to do that. Any help is appreciated.
BOb