为什么jqGrid无法转换序列化的datetime json?

时间:2015-02-07 20:20:24

标签: json jqgrid datetime-format jqgrid-asp.net

enter image description here

您好, Everythink完美没有jqGrid上的日期时间:S如何解决这个转换问题?

3 个答案:

答案 0 :(得分:1)

您可以在ColModel中尝试此操作

{name: 'colNmae', index: 'ColName', formatoptions: { srcformat: "ISO8601Long", newformat: "m/d/Y h:i A" }}

或者这个

{name: 'colNmae', index: 'ColName', sorttype: 'date', formatter: 'date', datefmt: 'd-M-Y'},

答案 1 :(得分:0)

您需要在colModel中将格式化程序设置为date,jqGrid将自动检测Microsoft日期格式。

不需要设置srcformat,但newformat可以是。

试试这个:

colModel : [
...
{name:'Mydate', ...formatter: 'date', formatoptions:{newformat 'm/d/Y'}, ...},
...
]

答案 2 :(得分:0)

这些列属性对我有用

formatter: "date", formatoptions: { newformat: "ISO8601Long" }