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

[Intl] relax some date parser patterns #32679

Merged
merged 1 commit into from Jul 23, 2019

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jul 23, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

While debugging the failures in #31374 I realised that the IntlDateFormatter from the Intl component parses dates more strictly than PHP's IntlDateFormatter class does.

@@ -548,8 +548,12 @@ public function testGetTimeType()
/**
* @dataProvider parseProvider
*/
public function testParse($pattern, $value, $expected)
public function testParse($pattern, $value, $expected, $requires64bit = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this new argument ever used ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it is. :)

@xabbuh
Copy link
Member Author

xabbuh commented Jul 23, 2019

Looks like PHP's IntlDateFormatter class parses years with three digits without errors, but returns the wrong date (see https://3v4l.org/QJFTJ), probably due to the same reasons that cause #29610 and #31057).

@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit 7d0793a into symfony:3.4 Jul 23, 2019
nicolas-grekas added a commit that referenced this pull request Jul 23, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] relax some date parser patterns

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

While debugging the failures in #31374 I realised that the `IntlDateFormatter` from the Intl component parses dates more strictly than PHP's `IntlDateFormatter` class does.

Commits
-------

7d0793a relax some date parser patterns
@xabbuh xabbuh deleted the intl-parser-format branch July 23, 2019 18:17
This was referenced Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants