-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pickers] Allow controlling the currently displayed year and month in the calendar components #16108
Comments
Hey there 👋 I am not sure the reference date will be of much help once the value is changed. |
@LukasTy Feels like the main problem here is displaying multiple calendars 🤔 |
If that's the case - ok. |
As @noraleonte has said there are no current plans to support multiple calendars, so the main point of the issue is controlling the reference date as this would allow for the user to build it themselves. Getting the calendars to sync and show dates properly selected is just a matter of a few lines of code. Multiple calendars are just an example. Having an external year picker or list of the website where the selection can be externally adjusted with different inputs or gestures could also be a scenario where controlling which month or year to display would be helpful. |
Summary
Currently the referenceDate can be used to define which month of the DateCalendar is initially displayed, but changes to it do not reflect in the current month displayed in the date calendar. I am trying to replace the next and previous Buttons with my own implementation.
I explicitly do not want to set the value or the default value of the component, but just control which month and date is displayed to the user
Examples
Motivation
As shown in the example the goal is to have multiple date pickers next to each other. In order to synch those I need to control the displayed month.
This can somehow we achieved by making the key dependent on the reference value, but this means that we are remounting the entire component every time we are changing the month.
The same motivation could previously be found here: https://stackoverflow.com/questions/76998078/how-can-i-have-two-calendars-in-the-datepicker-component-of-mui
Search keywords: reference date controlled date calendar
The text was updated successfully, but these errors were encountered: