mirror of
https://github.com/nicotsx/zerobyte.git
synced 2025-12-23 21:47:47 -05:00
Update app/utils/utils.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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} * *`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user