-
-
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] How to add Quarter View to DatePicker #15117
Comments
Not sure if we can support something like this atm. @LukasTy ? |
Hello @ChristianRaoulis, thank you for creating the issue. It might be possible to achieve it by providing a custom We will have this need in mind when improving the customizability. 😉 👍 For now, I'm adding this issue to our grooming board and adding a |
We had the quarter logic working with v5 by extending Sadly, this does not work with v7 anymore, as Right now we stay on v5 because the only option would be building our own MonthCalendar component which would require re-building lots of other functionality provided by While having built-in support for quarters would be great, a way to customize, extend or re-use existing components or hooks would also be fine. |
@oschwede thank you for your feedback and detailed explanation of your case. 👍 |
I understand that it was the best way to do it and that by removing this option from the adapter we prevented this customzation.
<MonthCalendar.Root>
{month => {
if (month.month() % 3 !== 0) return null;
return (
<MonthCalendar.Month value={month} />
})
</MonthCalendar.Root> This would not impact the field (which would still have all the months but at least all the field editing would be coherent).
|
Fair point regarding the fragility of overriding the adapter method. 👍 |
The problem in depth
We're trying to add a Year and Quarter Date Picker and struggle on getting the Quarter part to work. Is there a way to create a custom view for selecting quarters?
Your environment
`npx @mui/envinfo`
Search keywords: DatePicker
Order ID: 85157
The text was updated successfully, but these errors were encountered: