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

Fix IntlExtension::formatDateTime use of date formatter prototype #3844

Closed
wants to merge 4 commits into from

Conversation

drjayvee
Copy link
Contributor

@drjayvee drjayvee commented Jun 5, 2023

See twigphp/intl-extra#6 for more details

@stof
Copy link
Member

stof commented Jun 5, 2023

It would be great to have tests to prevent regressions.

@drjayvee
Copy link
Contributor Author

drjayvee commented Jun 5, 2023

It would be great to have tests to prevent regressions.

Voilà!

@fabpot
Copy link
Contributor

fabpot commented Oct 27, 2023

Thank you @drjayvee.

fabpot added a commit that referenced this pull request Oct 27, 2023
…totype (drjayvee)

This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Fix IntlExtension::formatDateTime use of date formatter prototype

See twigphp/intl-extra#6 for more details

Commits
-------

c75762c Fix IntlExtension::formatDateTime use of date formatter prototype
@fabpot
Copy link
Contributor

fabpot commented Oct 27, 2023

Merged

@fabpot fabpot closed this Oct 27, 2023
@keulinho
Copy link
Contributor

keulinho commented Nov 3, 2023

This change seems to break the fallback of using the timezone set in twigs CoreExtension.
The issue seems to be in this line:

        if (false === $formatterTimezone) {
            $formatterTimezone = $date->getTimezone();

$formatterTimezone is basically never false, as if it is not provided directly it is null, so the timezone from the converted date (which is based on the one configured in the CoreExtension) is never used.

Quickfix would be to use:

        if (null === $formatterTimezone) {
            $formatterTimezone = $date->getTimezone();

keulinho added a commit to keulinho/Twig that referenced this pull request Nov 3, 2023
fabpot added a commit that referenced this pull request Nov 21, 2023
…ulinho)

This PR was merged into the 3.x branch.

Discussion
----------

Fix timezone fallback to CoreExtension in IntlExtension

This is probably a regression from #3844

Refer to my comment on the original MR: #3844 (comment)

Commits
-------

144c4da Fix timezone fallback to CoreExtension in IntlExtension
symfony-splitter pushed a commit to twigphp/intl-extra that referenced this pull request Nov 21, 2023
…ulinho)

This PR was merged into the 3.x branch.

Discussion
----------

Fix timezone fallback to CoreExtension in IntlExtension

This is probably a regression from #3844

Refer to my comment on the original MR: twigphp/Twig#3844 (comment)

Commits
-------

144c4dac Fix timezone fallback to CoreExtension in IntlExtension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants