Issue with dates in Telerik's grid (admin)

8 years ago
I agree the Uri part is a hack otherwise we'd have to create a converter for each object type returned. Or use another serializer such as Json.Net. I also need to test this using other browsers than IE (not done yet) in case the Date implementation behaves differently when passed a date string (ISO 8601).
7 years ago
I guess Telerik's Grid will only convert DateTime from Utc to client time only when the DateTimeKind is Utc.

So I replace the code in controller
_dateTimeHelper.ConvertToUserTime(dataTime, DateTimeKind.Utc)
with
_dateTimeHelper.ConvertToUserTime(dataTime, TimeZoneInfo.Utc, TimeZoneInfo.Local)

It works for me.
7 years ago
jemmylu wrote:
I guess Telerik's Grid will only convert DateTime from Utc to client time only when the DateTimeKind is Utc.

So I replace the code in controller
_dateTimeHelper.ConvertToUserTime(dataTime, DateTimeKind.Utc)
with
_dateTimeHelper.ConvertToUserTime(dataTime, TimeZoneInfo.Utc, TimeZoneInfo.Local)

It works for me.


Thanks ... It also works for me. Simple solution...
4 years ago
And finally we have solved this issue.
You can see changes in this commit.
Please test it and let us know if there are any problems.