-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[feat]: Quick Navigation by Year in Calendar #6196
Comments
Perhaps we need to wait a long time for this, so I’ve created a simple version in the meantime. https://github.com/huybuidac/shadcn-datetime-picker ![]() |
@luchillo17 Hello. While using dropdown menus or select for quick month navigation is a great approach, there are already some existing implementations of this pattern (as seen in #1680 and #1739). Therefore, I propose an alternative solution utilizing two buttons for year navigation. This lightweight approach maintains a visually clean interface while providing efficient temporal navigation. |
The issue with those is that those have been open since October 2023 and yet no resolution (and those are actual PRs), I fear this one will follow a similar pattern where it's never realized in the library. |
Is there literally still no way to select a date, say for example, from feb 2000 without clicking the left arrow on the month 12*25 times? |
@oscadev Currently, there's no official implementation for direct date selection. While the default interface would require 12×25 clicks, the community has developed two practical solutions:
|
Also visually clean doesn't mean functional, the dropdown layout might need some refinements (especially this example I tweaked myself) but it's way better when the input is meant for distant dates like date of birth and such: |
Feature description
In the current version of the
Calendar
, there are only two buttons for navigating to the previous or next month.I wonder if it would be possible to add a way to select a specific year or month, similar to using
captionLayout="dropdown"
in React DayPicker. SinceCalendar
is built on theDayPicker
component from React DayPicker, it feels natural to extend this functionality. While we can setcaptionLayout
,fromYear
andtoYear
in<Calendar>
, this approach lacks official support from shadcn/ui, leading to bad caption styling.Alternatively, another approach could be to add two additional buttons on either side of the existing ones, allowing users to jump to the previous or next year, similar to the calendar in Ant Design. While this might require more effort, I guess adding two buttons could better align with the minimalist design philosophy of libraries like shadcn.
similar issue #880
Affected component/components
Calendar
Additional Context
Additional details here...
Before submitting
The text was updated successfully, but these errors were encountered: