mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-05 22:14:53 +00:00
resolve build error
This commit is contained in:
@@ -310,7 +310,7 @@ const StatisticCard = ({
|
||||
onClick?: () => void;
|
||||
}) => {
|
||||
return (
|
||||
<Card className="size-full overflow-hidden" hoverable loading={loading} variant="borderless" onClick={onClick}>
|
||||
<Card className="size-full overflow-hidden" hoverable loading={loading} bordered={false} onClick={onClick}>
|
||||
<Space size="middle">
|
||||
{icon}
|
||||
<Statistic
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { CronExpressionParser } from "cron-parser";
|
||||
import { parseExpression } from "cron-parser";
|
||||
|
||||
export const validCronExpression = (expr: string): boolean => {
|
||||
try {
|
||||
CronExpressionParser.parse(expr);
|
||||
parseExpression(expr);
|
||||
|
||||
if (expr.trim().split(" ").length !== 5) return false; // pocketbase 后端仅支持五段式的表达式
|
||||
return true;
|
||||
@@ -15,7 +15,7 @@ export const getNextCronExecutions = (expr: string, times = 1): Date[] => {
|
||||
if (!validCronExpression(expr)) return [];
|
||||
|
||||
const now = new Date();
|
||||
const cron = CronExpressionParser.parse(expr, { currentDate: now });
|
||||
const cron = parseExpression(expr, { currentDate: now });
|
||||
|
||||
return cron.take(times).map((date) => date.toDate());
|
||||
return cron.iterate(times).map((date) => date.toDate());
|
||||
};
|
||||
|
Reference in New Issue
Block a user