布置作业默认日期修改

This commit is contained in:
lyc 2024-08-15 10:31:11 +08:00
parent 2a84455f05
commit 6e8c96ce2e
1 changed files with 9 additions and 3 deletions

View File

@ -263,9 +263,15 @@ export default {
getCurrentDate() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1; // 0+1
const day = now.getDate()
return `${year}-${month.length == 2 ? month : '0' + month}-${day.length == 2 ? day : '0' + day}`;
let month = now.getMonth() + 1; // 0+1
let day = now.getDate()
if(month < 10){
month = '0' + month
}
if(day < 10){
day = '0' + day
}
return `${year}-${month}-${day}`;
},
validateGrade(rule, value, callback) {
if (this.studentList.length == 0) {