superset icon indicating copy to clipboard operation
superset copied to clipboard

Date Filter is possible to add datepicker calendar?

Open burlakabogdan opened this issue 9 years ago • 24 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [Y] I have checked the superset logs for python stacktraces and included it here as text if any
  • [Y] I have reproduced the issue with at least the latest released version of superset
  • [Y] I have checked the issue tracker for the same issue and I haven't found one similar

I greet everyone. Please add a drop-down calendar to the date filter, like default

Thank you.

burlakabogdan avatar Apr 10 '17 13:04 burlakabogdan

It's a bit more complicated than that as our current date dropdown allows for bot fixed dates and relative dates. Expressions like 52 weeks ago or 4 hours ago or 2015 currently work. We'd need a slightly more complex control with a radio button (relative or fixed) that shows a datepicker or some form for [input int] [frequency] [ago/from_now] depending...

mistercrunch avatar Apr 10 '17 15:04 mistercrunch

Perhaps it will be convenient for users. Thank you

burlakabogdan avatar Apr 11 '17 07:04 burlakabogdan

We are interested in implementing this feature. @mistercrunch : could we make some proposal about which widget to use? Do you have any advice ?

higaxman avatar May 17 '17 11:05 higaxman

Awesome @higaxman , it's now possible to build rich controls too. Here are a few thoughts:

  • the representation could be a simple text and a subtle edit icon
  • if no specific time is select (00:00:00) I wouldn't show it, just show what is relevant.
  • clicking the edit icon would pop a small bootstrap popover to the right of the text
  • inside the popover a radio button for fixed/relative
  • fixed would go along with the nicest react datepicker you can find, it has to allow date and time
  • relative would be perhaps 3 boxes
    • an input box that validates numeric
    • a time unit dropdown (seconds, minutes, hours, days, weeks, months, years), default to days
    • dropdown for ago or from now, defaults to ago
  • clicking the form controls in the popover flips the radio button accordingly to save a click. meaning if you click the time unit dropdown, it selects the relative option for the radiobutton, or if you click any part of the date picker, it chooses the fixed option
  • [probably out of scope], an option for UTC / timezones when using fixed dates

For an example of a rich control, check out this branch (unmerged) where I'm working on a popover for the metrics control. https://github.com/airbnb/superset/compare/metrics...mistercrunch:metrics?expand=1

mistercrunch avatar May 17 '17 17:05 mistercrunch

Thanks! Going to check it.

higaxman avatar May 20 '17 11:05 higaxman

I am very interested in this feature. Please keep up the good work! I look forward to using a date-picker filter.

DavidJHassan avatar May 25 '17 01:05 DavidJHassan

After a quick research, I'd go with http://dev.quri.com/react-bootstrap-datetimepicker/

mistercrunch avatar May 25 '17 05:05 mistercrunch

@mistercrunch is it better than https://github.com/airbnb/react-dates ?

xrmx avatar May 25 '17 13:05 xrmx

@xrmx we need the component to handle time as well, not just date

mistercrunch avatar May 25 '17 15:05 mistercrunch

Hey @higaxman how's your progress coming on this? I'd be happy to help

pariser avatar Jun 12 '17 18:06 pariser

Controls live here: https://github.com/airbnb/superset/tree/master/superset/assets/javascripts/explore/components/controls

Create 2 instances for since and until here: https://github.com/airbnb/superset/blob/master/superset/assets/javascripts/explore/stores/controls.jsx

Hard coded list here: https://github.com/airbnb/superset/blob/master/superset/assets/javascripts/explore/components/Control.jsx#L21 you can move this list to an index.jsx if you think it's better

mistercrunch avatar Jun 12 '17 19:06 mistercrunch

Hi @mistercrunch, wanted to know if we can use it ? or still in progress ? :)

vschoener avatar Aug 01 '17 09:08 vschoener

No one is working on this at the moment as far as I know

mistercrunch avatar Aug 02 '17 01:08 mistercrunch

So sad :'(

vschoener avatar Aug 02 '17 12:08 vschoener

@vschoener don't be sad, that's an opportunity for you to implement it.

xrmx avatar Aug 02 '17 12:08 xrmx

Will you add datepicker in next version? Any plans? AFAIK,datepicker is important for most developers and analysis.

emhlbmc avatar Sep 12 '17 08:09 emhlbmc

This as been done, will be in next release. screen shot 2017-09-15 at 8 23 07 am

mistercrunch avatar Sep 15 '17 15:09 mistercrunch

Will this be available in the FilterBox date filter as well? For dashboard filters.

Thanks.

TheScoobyBoy avatar Oct 19 '17 09:10 TheScoobyBoy

Yes it is

mistercrunch avatar Oct 25 '17 00:10 mistercrunch

Thanks all for Apache superset contribution and s/w.

My question is. Are there any sample dashboard reports available with date filters? My team is especially looking for having ability to switc/refresh the view based on reporting date change.

Him121 avatar Mar 18 '18 01:03 Him121