Skip to content

Commit

Permalink
修复任务列表下次运行时间展示
Browse files Browse the repository at this point in the history
  • Loading branch information
whyour committed Dec 3, 2024
1 parent a150170 commit 026640a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import intl from 'react-intl-universal';
import { LANG_MAP, LOG_END_SYMBOL } from './const';
import cron_parser from 'cron-parser';
import { ICrontab } from '@/pages/crontab/type';

export default function browserType() {
// 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
Expand Down Expand Up @@ -343,12 +344,12 @@ export function parseCrontab(schedule: string): Date | null {

export function getCrontabsNextDate(
schedule: string,
extra_schedules: string[],
extra_schedules: ICrontab['extra_schedules'],
): Date | null {
let date = parseCrontab(schedule);
if (extra_schedules?.length) {
extra_schedules.forEach((x) => {
const _date = parseCrontab(x);
const _date = parseCrontab(x.schedule);
if (_date && (!date || _date < date)) {
date = _date;
}
Expand Down

0 comments on commit 026640a

Please sign in to comment.