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

JsonFormatter::normalize() : respect date format from Formatter #1561

Merged
merged 2 commits into from
Jul 5, 2021

Conversation

thomasphansen
Copy link
Contributor

Hello! :)

This seems to be a leftover from #1459: JsonFormatter is not respecting the content of FormatterInterface->dateFormat.
The problem is because JsonFormatter extends the normalize method, but doesn't handle DateTimeInterface objects the same way parent::normalize() does. This PR fixes the issue. :)

@Seldaek
Copy link
Owner

Seldaek commented Jul 4, 2021

Makes sense, thanks

@Seldaek Seldaek added this to the 2.x milestone Jul 4, 2021
@Seldaek Seldaek added the Bug label Jul 4, 2021
@thomasphansen
Copy link
Contributor Author

Uh, sounds like I wasn't very careful before sending the push request... Sorry for that. I basically copied the lines and pasted on your code, without checking the code style and missing the use clause for DateTimeImmutable... :( Will do it better next time, I promise! :)

@Seldaek Seldaek force-pushed the th_jsonformatter_use_formatdate branch from 2a77aef to 4b9fdf7 Compare July 5, 2021 11:09
@Seldaek
Copy link
Owner

Seldaek commented Jul 5, 2021

No worries at all, easy enough to fix. The main problem was the test failures but I figured out the issue so now should be good to merge 👍🏻

@Seldaek Seldaek merged commit 172287b into Seldaek:main Jul 5, 2021
@thomasphansen thomasphansen deleted the th_jsonformatter_use_formatdate branch July 5, 2021 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants