Adding cron manager in front for database policy.

This commit is contained in:
charles-gauthereau
2024-12-12 15:32:33 +01:00
parent a55fba99f9
commit 382ec5c18d
14 changed files with 535 additions and 4 deletions
+11
View File
@@ -0,0 +1,11 @@
export const isValidCronPart = (type: string, value: string): boolean => {
const regexMap: Record<string, RegExp> = {
minute: /^(\*|([0-5]?\d)|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
hour: /^(\*|([01]?\d|2[0-3])|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
"day-of-month": /^(\*|([1-9]|[12]\d|3[01])|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
month: /^(\*|([1-9]|1[0-2])|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
"day-of-week": /^(\*|[0-6]|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
};
return regexMap[type]?.test(value) ?? false;
};