标签:函数 hpa lse 显示 span str ber function eth
在data-optios中添加如下函数
function zchformatter(date) { var y = date.getFullYear(); var m = date.getMonth() + 1; var d = date.getDate(); var h = date.getHours(); var M = date.getMinutes(); var s = date.getSeconds(); function formatNumber(value) { return (value < 10 ? ‘0‘ : ‘‘) + value; } var s = y + ‘/‘ + formatNumber(m) + ‘/‘ + formatNumber(d) + ‘ ‘ + formatNumber(h) + ‘:‘ + formatNumber(M) + ‘:‘ + formatNumber(s); return s; } function zchparser(s) { if ($.trim(s) == ‘‘) { return new Date(); } var dt = s.split(‘ ‘); var ss = dt[0].split(‘/‘); var y = parseInt(ss[0], 10); var m = parseInt(ss[1], 10) - 1; var d = parseInt(ss[2], 10); if (dt.length >= 2) { var tt = dt[1].split(‘:‘); var hour = parseInt(tt[0], 10) || 0; var minute = parseInt(tt[1], 10) || 0; var second = parseInt(tt[2], 10) || 0; } else { var hour = 0; var minute = 0; var second = 0; } var date = new Date(y, m, d); date.setHours(hour); date.setMinutes(minute); date.setSeconds(second); return date; }
2019-12-15 easyui string 格式字符串显示处理
标签:函数 hpa lse 显示 span str ber function eth
原文地址:https://www.cnblogs.com/hexx/p/12044384.html