-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I need to set a range validator on two dateinputs, so that date_from couldn't be newer than date_to.
This is how I expect that it should be:
$form['date_to']->addRule(Form::RANGE, "The date 'from' cannot be later than the date 'to'.", [$form['date_from'], null]);
but I'm receiving the following error:
Argument 1 passed to Vodacek\Forms\Controls\DateInput::normalizeDate() must be an instance of DateTime, instance of Vodacek\Forms\Controls\DateInput given, called in /data/src/interiors-remeslnici/vendor/voda/date-input/src/DateInput.php on line 138
So I had to write a server validation using onValidate[].
Metadata
Metadata
Assignees
Labels
No labels