预约课程-时间限制修改 #214

Merged
lyc merged 1 commits from lyc-dev into main 2024-09-18 10:53:29 +08:00
1 changed files with 12 additions and 5 deletions
Showing only changes of commit aee945f90f - Show all commits

View File

@ -178,16 +178,23 @@ const disabledHours = ()=>{
} }
// - // -
const disabledMinute = (hour,role) => { const disabledMinute = (hour,role) => {
if(form.time == null) return
if(getCurrentTime('YYYY-MM-DD') == form.day){ if(getCurrentTime('YYYY-MM-DD') == form.day){
const arrs = [] const arrs = []
if(role == 'start'){ if(role == 'start'){
for (let i = 0; i < 60; i++) { let nowHour = new Date().getHours().toString().padStart(2, '0');
if (new Date().getMinutes() <= i) continue; if(nowHour < hour){
arrs.push(i) return []
}
else{
for (let i = 0; i < 60; i++) {
if (new Date().getMinutes() <= i) continue;
arrs.push(i)
}
return arrs;
} }
return arrs;
} }
else{ if(role == 'end'){
if(form.time[0]) return [] if(form.time[0]) return []
} }
} }