field: 'FaultDate', title: '故障时间', templet: function (d) {
return showTime(d.FaultDate);}
js函数:
function showTime(tempDate) {
var date = tempDate.replace(/[^0-9]/ig, "");
var d = new Date(parseInt(date));
var year = d.getFullYear();
var month = d.getMonth(); month++; month = month < 10 ? "0" + month : month;
var day = d.getDate(); day = day < 10 ? "0" + day : day;
var time = year + "-" + month + "-" + day;
return time;
}