fix: corn表达式显示错误--bug=1006296 --user=陈建星 【github#5608】定时任务指定按周/星期的某一天执行不正确 https://www.tapd.cn/55049933/s/1042065
This commit is contained in:
parent
eead4da948
commit
333e71394f
|
@ -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--;// 星期日是第一天
|
||||||
|
|
||||||
//如果指定了每月最后一个星期几
|
//如果指定了每月最后一个星期几
|
||||||
//校验并调整如果是2月30号这种日期传进来时需调整至正常月底
|
//校验并调整如果是2月30号这种日期传进来时需调整至正常月底
|
||||||
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||||
|
|
Loading…
Reference in New Issue