(inputs: Record<string, any>)
| 609 | * end date (must be in the future if set), and mode-specific input validity. |
| 610 | */ |
| 611 | export const canScheduleEnable = (inputs: Record<string, any>): boolean => { |
| 612 | const cronResult = resolveScheduleCron(inputs) |
| 613 | const isEndDateValid = !inputs.scheduleEndDate || new Date(inputs.scheduleEndDate) > new Date() |
| 614 | const mode = inputs.scheduleInputMode |
| 615 | if (!mode) return false |
| 616 | const isInputValid = isScheduleInputValid(mode, inputs.scheduleDefaultInput, inputs.scheduleFormInputTypes) |
| 617 | return cronResult.valid && isEndDateValid && isInputValid |
| 618 | } |
no test coverage detected