Skip to content

Commit 6fde089

Browse files
KAICharles7c
authored andcommitted
fix(job): 修复预览CRON表达式结果不正确的问题
1 parent 33020be commit 6fde089

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,11 @@ export function dateFormat(date = new Date(), pattern = YMD_HMS) {
326326
*/
327327
const expressionNoYear = (cron: string) => {
328328
const vs = cron.split(' ')
329-
return vs.slice(0, vs.length - 1).join(' ')
329+
// 长度=== 7 包含年表达式 不解析
330+
if (vs.length === 7) {
331+
return vs.slice(0, vs.length - 1).join(' ')
332+
}
333+
return cron
330334
}
331335

332336
/**

0 commit comments

Comments
 (0)