jqgrid日期格式错误

时间:2013-05-08 20:25:39

标签: date jqgrid formatter

在我们绑定到格式化程序后,服务器返回一个格式为"2/6/2013"的日期的字符串,它显示如下:"12/4/2007"

{ 
    name: 'DueDate', 
    index: 'DueDate', 
    width: 110, 
    align: 'center', 
    resizable: false, 
    formatter:'date', 
    formatoptions: { newformat: 'm/d/Y' }, 
    datefmt: 'm/d/Y' 
}

为什么?

1 个答案:

答案 0 :(得分:0)

尝试在formatoptions

中指定源格式

即;

formatoptions: { srcformat:'d/m/Y',newformat: 'm/d/Y' }, 

或者您可以使用here

所述的自定义格式化程序
相关问题