Skip to content

Conversation

@lefb766
Copy link
Contributor

@lefb766 lefb766 commented Apr 7, 2018

This PR fixes a date format assertion bug or gotcha caused by DateTime::createFromFormat().

For example, Assertion::date('2018-04', 'Y-m') would throw in May 31 2018.
See
https://stackoverflow.com/questions/21473817/wrong-month-february-datetimecreatefromformat#21473903.

The applied solution was prepending '!' to user specified format before passing it to createFromFormat().
Apparently, it's not a problem if we have duplicated '!' s in a format string.

@rquadling rquadling merged commit 4c5545e into beberlei:master Apr 9, 2018
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

Successfully merging this pull request may close these issues.

2 participants