修改代码模板.

This commit is contained in:
lijiahang
2023-08-11 16:17:07 +08:00
parent 01ba756fa4
commit 2d50079e24
10 changed files with 87 additions and 30 deletions

View File

@@ -57,10 +57,12 @@ export function isEmptyStr(val: any) {
return typeof (val) === 'undefined' || val == null || val === '';
}
export const YMD_HMS = 'yyyy-MM-dd HH:mm:ss';
/**
* 格式化时间
*/
export function dateFormat(date = new Date(), pattern = 'yyyy-MM-dd HH:mm:ss') {
export function dateFormat(date = new Date(), pattern = YMD_HMS) {
const o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),