From e350843d4ec457cf76b2a984fadc259e79d5465b Mon Sep 17 00:00:00 2001 From: Alessandro Zappia <60665910+alexzapd@users.noreply.github.com> Date: Fri, 19 Dec 2025 22:34:19 +0100 Subject: [PATCH] Update app/utils/utils.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- app/utils/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/utils/utils.ts b/app/utils/utils.ts index ab015f4..bd8fd5a 100644 --- a/app/utils/utils.ts +++ b/app/utils/utils.ts @@ -16,7 +16,10 @@ export const getCronExpression = (frequency: string, dailyTime?: string, weeklyD } if (frequency === "monthly") { - const sortedDays = (monthlyDays || []).map(Number).sort((a, b) => a - b); + const sortedDays = (monthlyDays || []) + .map(Number) + .filter((day) => day >= 1 && day <= 31) + .sort((a, b) => a - b); const days = sortedDays.length > 0 ? sortedDays.join(",") : "1"; return `${minutes} ${hours} ${days} * *`; }