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

[Serializer] fixed DateTimeNormalizer to maintain microseconds when a different timezone required #29413

Merged
merged 1 commit into from Dec 2, 2018

Conversation

Projects
None yet
4 participants
@rvitaliy
Contributor

rvitaliy commented Dec 1, 2018

Q A
Branch? 3.4 up to 4.2 for bug fixes
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #
License MIT
Doc PR none

fixed DateTimeNormalizer::normalizer() when $object is mutated internally to change timezone we lost microseconds of origina $object

@rvitaliy rvitaliy force-pushed the rvitaliy:fix/DateTimeNormalizer-formatted-with-millisends branch from 4b12a97 to 06ec678 Dec 1, 2018

$object = clone $object;
}
$object = $object->setTimezone($timezone);

This comment has been minimized.

@ro0NL

ro0NL Dec 1, 2018

Contributor

mutating the original datetime is a change, but we safely clone any datetime no? https://3v4l.org/gdLh0

This comment has been minimized.

@nicolas-grekas

nicolas-grekas Dec 2, 2018

Member

in clear, you mean the change should be just:
$object = (clone $object)->setTimezone($timezone);

This comment has been minimized.

@rvitaliy

rvitaliy Dec 2, 2018

Contributor

@nicolas-grekas i can't do it in one line because php 5.5 don't support it

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Dec 1, 2018

@nicolas-grekas nicolas-grekas force-pushed the rvitaliy:fix/DateTimeNormalizer-formatted-with-millisends branch from c7d0381 to 2bf8a1c Dec 2, 2018

@nicolas-grekas

This comment has been minimized.

Member

nicolas-grekas commented Dec 2, 2018

Thank you @rvitaliy.

@nicolas-grekas nicolas-grekas merged commit 2bf8a1c into symfony:3.4 Dec 2, 2018

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Dec 2, 2018

bug #29413 [Serializer] fixed DateTimeNormalizer to maintain microsec…
…onds when a different timezone required (rvitaliy)

This PR was squashed before being merged into the 3.4 branch (closes #29413).

Discussion
----------

[Serializer] fixed DateTimeNormalizer to maintain microseconds when a different timezone required

| Q             | A
| ------------- | ---
| Branch?       | 3.4 up to 4.2 for bug fixes
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #
| License       | MIT
| Doc PR        | none

fixed `DateTimeNormalizer::normalizer()` when `$object` is mutated internally to change timezone we lost microseconds of origina `$object`

Commits
-------

2bf8a1c [Serializer] fixed DateTimeNormalizer to maintain microseconds when a different timezone required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment