IE中的Kendo grid datetime转换问题

时间:2016-12-21 09:49:38

标签: kendo-grid

大家好〜我正在使用Kendo网格从服务器端Web API显示日期时间列。

在Chrome中,结果会按预期显示。但在IE中,我遇到了一些问题:

在回复正文中,我得到了数据:

[{"SerialNO":43,"SurveyCyclesSN":null,"StartDateTime":"2016-12-21T00:00:00","EndDateTime":"2016-12-30T11:00:00"}]

在Chrome中,Kendo网格正确地将UTC时间转换为本地时间: the correct value

但在IE中,日期时间无法正确转换: the wrong value

对此问题的任何建议?感谢〜

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

 new Date(kendo.toString("Fri Dec 30 2016 19:00:00 GMT+0800")) or

 new Date("Fri Dec 30 2016 19:00:00 GMT+0800") 

它给了我=>

2016年12月30日星期五16:30:00 GMT + 0530(印度标准时间)

这是代码

 new Date(kendo.toString(StartDateTime))

附加图片: enter image description here

这就是您的数据: 看到红点。 enter image description here

你应该使用更好的格式化程序,如Newtonsoft json converter。