This commit is contained in:
2025-09-03 17:08:48 +08:00
parent 6a0c9b51dd
commit 3f3a908305
13 changed files with 1281 additions and 283 deletions

View File

@@ -36,4 +36,23 @@ export const dateFtt = date => {
}
return new Date(Date.parse(date))
}
/**
* 获取当前日期
*/
export const getDate = type => {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 10;
} else if (type === 'end') {
year = year + 10;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
}