Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Negative dateinterval #33052

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

Closed
z31fbras opened this issue Aug 8, 2019 · 1 comment
Closed

Negative dateinterval #33052

z31fbras opened this issue Aug 8, 2019 · 1 comment

Comments

@z31fbras
Copy link

z31fbras commented Aug 8, 2019

Symfony version(s) affected: 4.4.X

Description
The Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer does not accept negative dateinterval.
On the other hand, Doctrine\DBAL\Types\DateIntervalType, can deal with negative dateinterval.

Although, the ISO 8601 allows negative values to be defined.

Is it a wanted behaviour?
Do I misundestand something?

Thanks a lot for your help!

Possible Solution
Accept negative values on this normalizer.

@fabpot fabpot closed this as completed Aug 9, 2019
fabpot added a commit that referenced this issue Aug 9, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix negative DateInterval

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

This PR adds support for negative and signed DateInterval

Commits
-------

abb8a67 Fix negative DateInterval
@z31fbras
Copy link
Author

z31fbras commented Aug 9, 2019

Thanks a lot for your help @jderusse 😄

hultberg pushed a commit to hultberg/symfony that referenced this issue Sep 17, 2021
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix negative DateInterval

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

This PR adds support for negative and signed DateInterval

Commits
-------

abb8a67 Fix negative DateInterval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants