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

Need help to support simpler date range selection in calendar #7153

Open
sabarnix opened this issue Mar 1, 2024 · 0 comments
Open

Need help to support simpler date range selection in calendar #7153

sabarnix opened this issue Mar 1, 2024 · 0 comments

Comments

@sabarnix
Copy link
Contributor

sabarnix commented Mar 1, 2024

Trying to change the calendar date range selection behaviour. Currently it's like google flights date picker, which is confusing without date inputs to select start/end date.

Expected Behavior

If both start date and end date is selected, on clicking any date it should reset the selection and set start date.

Actual Behavior

I was able to achieve this using the activeDate prop. The problem is I need to support same start date and end date. But, as per current behaviour if same date is selected twice the selection resets. This is because of the which clears the selection if selected date is equal to start date or end date. Can we add a prop to allow setting same start date and end date?

I can submit a merge request for it.

Below I have shared a codesandbox link which explains the problem.

URL, screen shot, or Codepen exhibiting the issue

https://codesandbox.io/p/sandbox/quizzical-cannon-qzw7sl?file=%2Fsrc%2FApp.js%3A17%2C41

Steps to Reproduce

  1. Select a date
  2. Select the same date again

Your Environment

  • Grommet version: latest
  • Browser Name and version: chrome
  • Operating System and version (desktop or mobile): Macos/mbp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant