Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix reminder cron expression validation

Abdullah Atta1e295d856263
diff --git a/apps/web/src/utils/task-scheduler.ts b/apps/web/src/utils/task-scheduler.ts
index 922e34f52..b02fa8616 100644
--- a/apps/web/src/utils/task-scheduler.ts
+++ b/apps/web/src/utils/task-scheduler.ts
@@ -24,15 +24,15 @@ import type {
} from "./task-scheduler.worker";
import { wrap, Remote } from "comlink";
import { showToast } from "./toast";
-import dayjs from "dayjs";
import { logger } from "./logger";
+import { validate } from "cronosjs";
let worker: globalThis.Worker | undefined;
let scheduler: Remote<TaskSchedulerType> | undefined;
export class TaskScheduler {
static async register(id: string, time: string, action: () => void) {
- if (!dayjs(time).isValid()) {
+ if (!validate(time)) {
logger.error(`Invalid cron expression: ${time}`);
return;
}