Skip to content

DateRangePicker: add ability for predefined ranges #608

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hoorayimhelping
Copy link
Collaborator

Adds predefined monthly -ranges to the DateRangePicker.

The ranges are added by using the prop predefinedDatesCount. Up to 6 months can be added. 6 adds months in the future, -6 adds months in the past.

<DateRangePicker
  onSelectDateRange={handleSelectDate}
  predefinedDatesCount={-6}
/>

Video

Screen.Recording.2025-06-09.at.12.19.54.PM.mov

Screenshots

Dropdown

Screenshot 2025-06-09 at 12 17 08 PM

Dropdown and custom date range picker

Screenshot 2025-06-09 at 12 17 12 PM

The custom date range picker after selecting a range (the current month)

Screenshot 2025-06-09 at 12 17 22 PM

Full month selected

Screenshot 2025-06-09 at 12 17 41 PM

Fewer than 6 ranges

Screenshot 2025-06-09 at 12 26 04 PM

Copy link

vercel bot commented Jun 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
click-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2025 4:29pm

@crisalbu
Copy link

Hey @hoorayimhelping , sorry for the late reply.

I was wondering, could we do this instead? I realize you may need to make more than a simple change, but it would look better I think 🙂

Screenshot 2025-06-16 at 15 02 38

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

Successfully merging this pull request may close these issues.

2 participants