[RFR] Fixing date filter to not consider empty string as a current date#382
Merged
dunglas merged 1 commit intoJan 11, 2016
Merged
Conversation
501c781 to
253652a
Compare
|
👍 but you should add some tests to prevent future regressions (and proof it's working). |
Contributor
|
I definitely agree with the idea. Can you add Behat tests? Then that would be good 👍 |
Member
|
👍 |
253652a to
fd0d73e
Compare
Author
|
Tests added. |
dunglas
added a commit
that referenced
this pull request
Jan 11, 2016
[RFR] Fixing date filter to not consider empty string as a current date
Member
|
Thanks @salahm |
Contributor
|
Is there a reason this change is not present in newer APIP versions? It seems this only went into the |
Contributor
|
@dunglas Can you check this? It is missing in API Platform 2.x, 3.x and 4.x. |
Member
|
Feel free to cherry-pick that and open a PR |
Contributor
|
Started in #7291 now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Actually when we use DateFilter, if we send an empty parameter
property[before]=, doctrine will convert it to current date (new \Datetime('')). This is annoying for a filtering behaviour, empty params should be ignored.If we want use currentDate in DateFilter, we can use
nowstring.