diff --git a/src/FormElement/ScheduleElement.php b/src/FormElement/ScheduleElement.php index f5e7912f..f872f49b 100644 --- a/src/FormElement/ScheduleElement.php +++ b/src/FormElement/ScheduleElement.php @@ -502,7 +502,10 @@ protected function assemble() $isValid = $this->isValid(); $reason = null; if (! $isValid && $this->getFrequency() === static::CUSTOM_EXPR) { - if (! $this->getElement('interval')->isValid()) { + if ( + $this->getCustomFrequency() !== RRule::YEARLY + && ! $this->getElement('interval')->isValid() + ) { $reason = current($this->getElement('interval')->getMessages()); } else { $frequency = $this->getCustomFrequency(); @@ -511,9 +514,13 @@ protected function assemble() $reason = current($this->weeklyField->getMessages()); break; - default: // monthly + case RRule::MONTHLY: $reason = current($this->monthlyFields->getMessages()); + break; + default: // annually + $reason = current($this->annuallyFields->getMessages()); + break; } }