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

Date/Time Range Filter #60971

Open
emaurer11 opened this issue Apr 22, 2024 · 6 comments
Open

Date/Time Range Filter #60971

emaurer11 opened this issue Apr 22, 2024 · 6 comments
Labels
Design System Issues related to the system of combining components according to best practices. [Feature] UI Components Impacts or related to the UI component system Needs Design Feedback Needs general design feedback. Needs Design Needs design efforts. [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@emaurer11
Copy link

emaurer11 commented Apr 22, 2024

What problem does this address?

The current component does not:

  • select date ranges
  • allow users to also choose custom times

What is your proposed solution?

  • build custom calendar for selecting date ranges see demo
  • add ability to select time presets
  • build out responsive (mobile) version of the component (noting that the design for this is not completed yet)

cc @noisysocks

time dropdown
@emaurer11 emaurer11 added the [Type] Enhancement A suggestion for improvement. label Apr 22, 2024
@colorful-tones

This comment was marked as resolved.

@noisysocks noisysocks added [Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components Needs Design Feedback Needs general design feedback. Needs Design Needs design efforts. and removed Needs Design Feedback Needs general design feedback. labels Apr 23, 2024
@noisysocks
Copy link
Member

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
Copy link
Member

mirka commented Apr 24, 2024

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
Copy link
Contributor

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
  • A SelectControl contains any preset options
  • When 'Custom' is chosen, two instances of TimePicker are revealed. These are used to set the From and To dates

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

date-filter

@jameskoster
Copy link
Contributor

jameskoster commented Sep 25, 2024

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

Combo_ Presets + simple date range

Combo: Presets + custom date range with calendar

Combo_ Presets + date range with calendar

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

@ciampo
Copy link
Contributor

ciampo commented Sep 25, 2024

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:

  • on mobile devices, where they'd get a tailored mobile UI;
  • as a V1 of the component, while the rich calendar UI gets implemented;

Also, I have a couple of questions:

  • I see that all inputs also show a time — how would a user be able to set that?
  • the component can take quite a wide portion of space — what happens if there isn't as much space? Ie. responsive layouts, sidebars, mobile screens, etc

@jameskoster jameskoster added the Design System Issues related to the system of combining components according to best practices. label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design System Issues related to the system of combining components according to best practices. [Feature] UI Components Impacts or related to the UI component system Needs Design Feedback Needs general design feedback. Needs Design Needs design efforts. [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
Status: No status
Status: 🔦 Needs triage
Development

No branches or pull requests

6 participants