Add DateTimeRangeFilter and DateRangeFilter #593
Merged
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.
Subject
The refactor is based on #142 and https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/b59f9e58b8d80ec8fc2e95c5ddff507bd82b8134/src/Filter/AbstractDateFilter.php
I targeted
master
since there are some BC breaks, maybe this can be done in a BC way, but I don't think it's worth it since we are supposed to release4.0
soon.AbstractDateFilter has been refactored to support range queries, similar to the implementation of sonata-project/doctrine-orm-admin-bundle.
The option
input_type
has been removed since it was not used.Prior to this change when filtering using a
DateFilter
orDateTimeFilter
withequals
type, it created a rangequery internally. Now you have to use
DateRangeFilter
orDateTimeRangeFilter
and provide a range of dates.I am targeting this branch, because these changes break BC.
Closes #550.
Changelog