MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / nextTimeDisplay

Function nextTimeDisplay

src/pkg/utils/cron.ts:87–96  ·  view source on GitHub ↗
(crontab: string, date = new Date())

Source from the content-addressed store, hash-verified

85 * - 否则直接返回下一次执行时间字符串
86 */
87export const nextTimeDisplay = (crontab: string, date = new Date()): string => {
88 try {
89 const res = nextTimeInfo(crontab, date);
90 const nextTimeFormatted = res.next.toFormat(res.format);
91 return res.once ? t(`cron_oncetype.${res.once}`, { next: nextTimeFormatted }) : nextTimeFormatted;
92 } catch (e) {
93 console.error(`nextTimeDisplay: Invalid cron expression "${crontab}"`, e);
94 return t("cron_invalid_expr");
95 }
96};
97
98/**
99 * 解析 cron 表达式,提取 once 信息并转换为标准 cron 表达式。

Callers 8

TaskCardFunction · 0.90
AgentTasksFunction · 0.90
handleToggleFunction · 0.90
handleModalOkFunction · 0.90
ScriptTable.tsxFile · 0.90
ScriptCard.tsxFile · 0.90
useInstallDataFunction · 0.90
utils.test.tsFile · 0.90

Calls 2

nextTimeInfoFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected