mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
修复定时任务列表格式化 crontab
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { LOG_END_SYMBOL } from './const';
|
||||
import cron_parser from 'cron-parser';
|
||||
|
||||
export default function browserType() {
|
||||
// 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
|
||||
@@ -326,3 +327,14 @@ export function getCommandScript(
|
||||
}
|
||||
return [s, p];
|
||||
}
|
||||
|
||||
export function parseCrontab(schedule: string): Date {
|
||||
try {
|
||||
const time = cron_parser.parseExpression(schedule);
|
||||
if (time) {
|
||||
return time.next().toDate();
|
||||
}
|
||||
} catch (error) {}
|
||||
|
||||
return new Date('1970');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user