diff --git a/desktop/src/features/workflows/ui/WorkflowScheduleFields.tsx b/desktop/src/features/workflows/ui/WorkflowScheduleFields.tsx index bd25daaa9..8bb0db807 100644 --- a/desktop/src/features/workflows/ui/WorkflowScheduleFields.tsx +++ b/desktop/src/features/workflows/ui/WorkflowScheduleFields.tsx @@ -28,16 +28,9 @@ const WEEKDAYS = [ const MONTH_DAYS = Array.from({ length: 31 }, (_, index) => String(index + 1)); function monthlyDayWarning(monthDay: string): string | null { - switch (monthDay) { - case "29": - return "Day 29 does not occur in February every year, so this schedule will occasionally skip a month."; - case "30": - return "Day 30 does not occur in February, so this schedule will skip February."; - case "31": - return "Day 31 does not occur in every month, so this schedule will skip shorter months."; - default: - return null; - } + return Number(monthDay) > 28 + ? "This schedule won’t run in some months." + : null; } function customCronSeed(schedule: ScheduleFormState): string { diff --git a/desktop/tests/e2e/workflows.spec.ts b/desktop/tests/e2e/workflows.spec.ts index 630859e51..580d2d699 100644 --- a/desktop/tests/e2e/workflows.spec.ts +++ b/desktop/tests/e2e/workflows.spec.ts @@ -145,9 +145,7 @@ test("configures common schedules and exposes custom cron", async ({ await inspector.getByText("Monthly", { exact: true }).click(); await inspector.getByLabel("Day of month").selectOption("31"); await expect( - inspector.getByText( - "Day 31 does not occur in every month, so this schedule will skip shorter months.", - ), + inspector.getByText("This schedule won’t run in some months."), ).toBeVisible(); await dialog.getByRole("tab", { name: "YAML" }).click(); await expect(dialog.getByLabel("Workflow YAML")).toHaveValue(