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

Add an "exact" parameter to DateFilter #6114

Open
flegars opened this issue Jan 16, 2024 · 1 comment · May be fixed by #6884
Open

Add an "exact" parameter to DateFilter #6114

flegars opened this issue Jan 16, 2024 · 1 comment · May be fixed by #6884

Comments

@flegars
Copy link

flegars commented Jan 16, 2024

Description
Hi,

Does adding an "exact" setting regarding the date filter seem like something realistic? Although it is possible to obtain the same result via the available settings it could be nice to be able to filter on a very specific date

Example

#[ApiResource(
    'operations' => [
        new GetCollection()
    ]
)
#[ApiFilter(DateFilter::class, properties: ['date' => 'exact'])]
class Book
{
    private int $id;

    private \DateTime $date;
}

Using it would be done as follows:

/api/books?date[exact]=2024-01-16T13:26:00Z
@soyuka
Copy link
Member

soyuka commented Mar 15, 2024

Sure, feel free to open a PR

vjandrea added a commit to vjandrea/api-platform-core that referenced this issue Dec 22, 2024
vjandrea added a commit to vjandrea/api-platform-core that referenced this issue Dec 22, 2024
vjandrea added a commit to vjandrea/api-platform-core that referenced this issue Dec 22, 2024
vjandrea added a commit to vjandrea/api-platform-core that referenced this issue Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants