|
|
|
@ -187,4 +187,25 @@ function alertSound(id,src){
|
|
|
|
|
var p = b.play();
|
|
|
|
|
p && p.then(function(){}).catch(function(e){});
|
|
|
|
|
}
|
|
|
|
|
//日期格式化
|
|
|
|
|
function formatDate(dateString, format = 'yyyy-MM-dd HH:mm:ss') {
|
|
|
|
|
const date = new Date(dateString);
|
|
|
|
|
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
const hour = String(date.getHours()).padStart(2, '0');
|
|
|
|
|
const minute = String(date.getMinutes()).padStart(2, '0');
|
|
|
|
|
const second = String(date.getSeconds()).padStart(2, '0');
|
|
|
|
|
|
|
|
|
|
const formattedDate = format
|
|
|
|
|
.replace(/yyyy/g, year)
|
|
|
|
|
.replace(/MM/g, month)
|
|
|
|
|
.replace(/dd/g, day)
|
|
|
|
|
.replace(/HH/g, hour)
|
|
|
|
|
.replace(/mm/g, minute)
|
|
|
|
|
.replace(/ss/g, second);
|
|
|
|
|
|
|
|
|
|
return formattedDate;
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|