fix(job): 修复预览CRON表达式结果不正确的问题

This commit is contained in:
KAI
2024-10-10 07:17:21 +00:00
committed by Charles7c
parent 33020beb36
commit 6fde089ba6

View File

@@ -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
}
/**