处理方式,formatter 方式回显,js处理日期格式问题
代码如下:
{name:'paytime',index:'paytime',
formatter:function(cellvalue, options, rowObject){
if(cellvalue==null ||cellvalue==""){return ""}
var time = new Date(cellvalue);
return time.getFullYear()+"-"
+(time.getMonth()<9?("0"+(time.getMonth()+1)):(time.getMonth()+1))+"-"
+(time.getDate()<10?("0"+time.getDate()):(time.getDate()))+" "
+(time.getHours()<10?("0"+time.getHours()):(time.getHours()))+":"
+(time.getMinutes()<10?("0"+time.getMinutes()):(time.getMinutes()))+":"
+(time.getSeconds()<10?("0"+time.getSeconds()):(time.getSeconds()));
}},