jqGrid的formatter扩展性还是比较好用的。对于日期处理还有点欠缺
项目中,后台服务未对日期项目做特殊处理,导致1/1/1,1900/1/1,不能正常显示。
为了减少后台修改量,只能修改jqGrid的源码。
parseDate : function(format, date, newformat, opts) {
//存在年为1,或者1900/1/1,则返回空
if (Y == 1 || (Y == 1900 && n == 1 && w == 1)) {
return "";
}
return newformat.replace(token, function ($0) {
return flags.hasOwnProperty($0) ? flags[$0] : $0.substring(1);
});
},