DateValidator returns false on proper date

Dear,

For a registration form i use the DateValidator for validating a date of birth field. I use it as follows;


[['date_of_birth'], 'date', 'format' => 'dd-MM-yyyy', 'on' => ['register', 'editInformation']],

When i fill in 08-04-1991 as date, and press submit the validator return FALSE on this field, so the form can’t be submitted. But the date format i entered should be 100% valid and match the format i entered in the validator rule.

Even when i set the format to;


[['date_of_birth'], 'date', 'format' => 'php:d-m-Y', 'on' => ['register', 'editInformation']],

It won’t validate.

Only when i remove the validation rule, the form can be submitted.

What could be the problem here?

I don’t see anything wrong here. My bet is this rule is fine, look for a problem somewhere else.

Post view, action and all validation rules.