初始化

This commit is contained in:
zhu
2026-03-27 13:29:41 +08:00
commit ee03132cee
112 changed files with 6417 additions and 0 deletions

29
utils/wxs/comment.wxs Normal file
View File

@@ -0,0 +1,29 @@
module.exports = {
/**
* 日期格式化
* @param {Date | String | Number} date
* @param {String} format 格式
*/
formatDate: function (date, format) {
if (!format) {
format = 'YYYY/MM/DD hh:mm:ss';
}
if (!date) {
return '';
}
date = getDate(date)
var YYYY = date.getFullYear();
var MM = ('0' + (date.getMonth() + 1)).slice(-2)
var DD =('0' + date.getDate()).slice(-2);
var hh = ("0" + date.getHours()).slice(-2);
var mm = ("0" + date.getMinutes()).slice(-2);
var ss = ("0" + date.getSeconds()).slice(-2);
var result = format.replace(getRegExp('YYYY'), YYYY)
.replace(getRegExp('MM'), MM)
.replace(getRegExp('DD'), DD)
.replace(getRegExp('hh'), hh)
.replace(getRegExp('mm'), mm)
.replace(getRegExp('ss'), ss)
return result;
},
};