avo icon indicating copy to clipboard operation
avo copied to clipboard

Is there a way to create a date filter?

Open rajaravivarma-r opened this issue 3 years ago • 8 comments

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-component

Date range picker

unnamed

rajaravivarma-r avatar Sep 12 '22 07:09 rajaravivarma-r

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

adrianthedev avatar Sep 12 '22 14:09 adrianthedev

I believe @OlexYakov has more insight on this! (he is on vacation now though)

nicholaswellens avatar Sep 12 '22 17:09 nicholaswellens

Hi @adrianthedev, I will think about creating a PR. Thanks for the pointer.

rajaravivarma-r avatar Sep 12 '22 18:09 rajaravivarma-r

@nicholaswellens Ok. For the time being I'll see what I can do.

rajaravivarma-r avatar Sep 12 '22 18:09 rajaravivarma-r

@rajaravivarma-r as @nicholaswellens mentioned, I did create a date (and daterange) picker filter. I could create a PR (probably tomorrow) if you want.

OlexYakov avatar Sep 13 '22 14:09 OlexYakov

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 avatar Sep 13 '22 14:09 OlexYakov

@OlexYakov Thanks. I'll take a look.

rajaravivarma-r avatar Sep 13 '22 21:09 rajaravivarma-r

This issue has been marked as stale because there was no activity for the past 15 days.

github-actions[bot] avatar Sep 29 '22 04:09 github-actions[bot]

Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️

github-actions[bot] avatar Oct 14 '22 04:10 github-actions[bot]

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?

murpj238 avatar Nov 18 '22 11:11 murpj238

Because it still requires some work. We'd love to get your help with this.

adrianthedev avatar Nov 18 '22 12:11 adrianthedev