appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 468 forks source link

Date Range component #151

Closed metagrover closed 6 years ago

metagrover commented 6 years ago

Bug Report

Current behavior:

If you have an end-date selected (screenshot - 2018-02-14), and clear the start-date, you will be able to select any date in the calendar as the start-date, even the dates after 2018-02-14.

screen shot 2017-12-27 at 8 51 31 pm

Also, if I have an end date selected, and I'm selecting the start date, the calendar should grey-out irrelevant dates (i.e. the dates after the end date)

Allow users to change the middle -'s markup which connects two input fields together. Possible usecase: You may want to change the - to an arrow (->) or to.

Expected / new behavior:

Reactivesearch version: latest

siddharthlatest commented 6 years ago

In the possible customizations support, it should be possible to change the entire top portion including the input fields.

An example from Airbnb.

screen shot 2017-12-28 at 12 13 45 am

Another example from Kayak.

another from kayak

metagrover commented 6 years ago

For custom rendering, we can use onDayChange from react-day-picker to expose the current selection and render as we please with a custom trigger to open the calendar view.

metagrover commented 6 years ago

UX Issues:

When the date range is already selected, and now you modify the start date such that (end date - start date > 1 month duration), the calendar auto-focuses on the end date.

ezgif com-video-to-gif

Correct behavior: It should focus on the start date if you are changing the start date. It should focus on the end date if you are changing the end date.