fix: corn表达式显示错误--bug=1006296 --user=陈建星 【github#5608】定时任务指定按周/星期的某一天执行不正确 https://www.tapd.cn/55049933/s/1042065

This commit is contained in:
chenjianxing 2021-08-31 14:58:53 +08:00 committed by jianxing
parent eead4da948
commit 333e71394f
1 changed files with 13 additions and 7 deletions

View File

@ -221,6 +221,8 @@
// //
// //
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week'); let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
thisWeek++ //
//dayRuleSup //dayRuleSup
if (this.dayRuleSup.indexOf(thisWeek) < 0) { if (this.dayRuleSup.indexOf(thisWeek) < 0) {
// //
@ -235,6 +237,8 @@
continue; continue;
} }
} else if (this.dayRule == 'assWeek') { } else if (this.dayRule == 'assWeek') {
this.dayRuleSup[1]--;//
// //
//1 //1
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week'); let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
@ -244,6 +248,8 @@
DD = this.dayRuleSup[0] * 7 + this.dayRuleSup[1] - thisWeek + 1; DD = this.dayRuleSup[0] * 7 + this.dayRuleSup[1] - thisWeek + 1;
} }
} else if (this.dayRule == 'lastWeek') { } else if (this.dayRule == 'lastWeek') {
this.dayRuleSup--;//
// //
//230 //230
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {