avo
avo copied to clipboard
Is there a way to create a date filter?
Feature
We would like to filter items created in a date range. I've gone through the docs and issues but couldn't find a way to achieve this. Is there a way to create a date range or date filter?
Current workarounds
Probably create a TextFilter and parse that as date time to achieve this.
Screenshots
Date picker

Date range picker

Hey @rajaravivarma-r. There isn't a ways of doing that yet, but I see how that would be useful! Date ranges too.
We don't have that on our roadmap yet so if you want to put up a PR, I'd be happy to help you navigate the codebase. Here's a similar PR from a contributor that added the text filter https://github.com/avo-hq/avo/pull/530
We'd like to add this type of filtering soon. https://github.com/avo-hq/avo/issues/1154
I believe @OlexYakov has more insight on this! (he is on vacation now though)
Hi @adrianthedev, I will think about creating a PR. Thanks for the pointer.
@nicholaswellens Ok. For the time being I'll see what I can do.
@rajaravivarma-r as @nicholaswellens mentioned, I did create a date (and daterange) picker filter. I could create a PR (probably tomorrow) if you want.
For now you can check this draft PR https://github.com/avo-hq/avo/pull/1229. To create a filter, you would do something like:
class CreatedAtFilter < Avo::Filters::DateTimeFilter
self.name = "Created at filter"
self.with_time = true # default false, can omit
self.date_field = :created_at
end
@OlexYakov Thanks. I'll take a look.
This issue has been marked as stale because there was no activity for the past 15 days.
Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️
Hi @adrianthedev @OlexYakov, this has come up as a requirement multiple times for us recently. The PR has gone stale, is there any reason why it hasn't been merged in?
Because it still requires some work. We'd love to get your help with this.