Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range validator problem #16

Open
H0w4rd opened this issue Sep 13, 2017 · 0 comments
Open

Range validator problem #16

H0w4rd opened this issue Sep 13, 2017 · 0 comments

Comments

@H0w4rd
Copy link

H0w4rd commented Sep 13, 2017

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[].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant