easyui 时间定格为 时分
$.fn.datetimebox.defaults.formatter = function (date) { console.log('dt formatting ' + date); if (!(date instanceof Date)) date = new Date(date); var h = date.getHours(); var M = date.getMinutes(); var s = date.getSeconds(); function _ff(v) { return (v < 10 ? "0" : "") + v; }; return date.getFullYear() + '-' + _ff(date.getMonth() + 1) + '-' + _ff(date.getDate()) + ' ' + _ff(h) + ':' + _ff(M); }; $.fn.datetimebox.defaults.parser = function (s) { console.log('dt formatting ' + s); if ($.trim(s) == "") { return new Date(); } var dt = s.split(" "); var p1 = dt[0].split('-'); var p2; try { p2 = dt[1].split(':'); } catch (err) { p2 = ['00', '00'] } return new Date(p1[0], p1[1] - 1, p1[2], p2[0], p2[1]); };
复写easyui的databo方法
无为而治