Skip to content

Commit

Permalink
fix(job): 修复预览CRON表达式结果不正确的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
KAI authored and Charles7c committed Oct 10, 2024
1 parent 33020be commit 6fde089
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ export function dateFormat(date = new Date(), pattern = YMD_HMS) {
*/
const expressionNoYear = (cron: string) => {
const vs = cron.split(' ')
return vs.slice(0, vs.length - 1).join(' ')
// 长度=== 7 包含年表达式 不解析
if (vs.length === 7) {
return vs.slice(0, vs.length - 1).join(' ')
}
return cron
}

/**
Expand Down

0 comments on commit 6fde089

Please sign in to comment.