WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.55k stars 4.22k forks source link

Date/Time Range Filter #60971

Open emaurer11 opened 7 months ago

emaurer11 commented 7 months ago

What problem does this address?

The current component does not:

What is your proposed solution?

cc @noisysocks

time dropdown
colorful-tones commented 7 months ago

All the links in this request are private P2s. This does not seem all that transparent, and it might be advisable to keep the discussion to internal P2s since nobody beyond Automattic employees has visibility into the full context.

noisysocks commented 7 months ago

Thanks for sharing your mockups of this. I believe we'll need this for Data Views so it makes sense to add this feature to @wordpress/components.

mirka commented 7 months ago

Just to make sure we're on the same page — we are buildling a new DateRangePicker (name TBD) that is two DatePickers linked together with range selection functionality. Everything else in the mockup is extender territory.

We'll probably need to change the "selected date" indicator in DatePicker itself from a circle to a square so it translates better into a range selection scenario.

jameskoster commented 2 months ago

Exploring this one from a slightly different angle, based on the idea that a date range picker component could just be two instances of TimePicker (itself utilising the native datetime-local input type):

daterange

Here's how this might work in a filtering situation:

date-filter
jameskoster commented 2 months ago

Coming back to this one with some updated designs, still built upon native input types but augmented with calendar UIs.

Presets only

Presets

This design would make use of the Menu component for the UI and would be handy for quickly filtering certain data views.

Simple date range

Simple date range

This one could potentially be two instances of TimePicker. For use where a permanently-visible calendar UI is not useful or would be too prominent.

Simple date range with calendar UI

Simple date range with calendar

As above, but augmented by a permanently-visible calendar UI. For users of assistive technology (and perhaps folks who prefer navigating by keyboard) I suspect the native inputs to be the primary point of interaction, but for mouse users the calendar would be more ergonomic.


The following are more advanced combinations of the above. In each case the inputs / calendar would be revealed only when electing to specify a custom range rather than a preset.

Combo: Presets + simple custom date range

Image

Combo: Presets + custom date range with calendar

Image

This one is very similar to the design in the OP. The calendar interactions could be the same.

ciampo commented 2 months ago

a permanently-visible calendar UI

By displaying the native range picker UI we'd get a lot of functionality for free — but if, in any case, we need to show an interactive, rich calendar UI, then it would make sense to use that UI also in the "Simple date range" case (and, why not, for any date picker, even when not selecting a range.

IMO, using the native date picker UI could only make sense for these scenarios:

Also, I have a couple of questions: