#17642 - Reset day parameter when using Y-m#20566
Conversation
|
@taylorotwell @BramRoets Unfortunately. This still doesn't fix the problem, it's making the assumption your format will be My pull request back in January #17693 did solve the problem but got closed :( $date = DateTime::createFromFormat('!' . $parameters[0], $value);Thats all it takes, I'm not sure why we can't just go with this, remove the extra test and thats the problem solved. |
|
@taylorotwell this bug is causing our app to crash badly today. It's the 31st of August today, which means that any month that doesn't have 31 days fails validation. The format we're using is The solution to prefix
@arjasco was on point here and his closed PR should be merged asap. |
|
We're currently using this as an interim solution. Is it necessary to check that the date equals the value? Surely if it could be resolved at all should be sufficient? $validator->extend('hotfix_date_format', function ($attribute, $value, $parameters, $validator) {
return (is_string($value) || is_numeric($value))
&& (DateTime::createFromFormat($parameters[0], $value) !== false);
}); |
This should fix #17642
Note: this bug only happens when the computers date is set to 31/xx/xxx (or any date not existing in february)