lyc-dev #135

Merged
lyc merged 2 commits from lyc-dev into main 2024-08-15 10:32:17 +08:00
1 changed files with 9 additions and 3 deletions

View File

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