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

[pickers] Customize MonthCalendar and YearCalendar slots #10467

Closed
2 tasks done
andrejremic opened this issue Sep 25, 2023 · 4 comments
Closed
2 tasks done

[pickers] Customize MonthCalendar and YearCalendar slots #10467

andrejremic opened this issue Sep 25, 2023 · 4 comments
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature support: commercial Support request from paid users

Comments

@andrejremic
Copy link

Order ID or Support key 💳 (optional)

#52617

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

The problem in depth 🔍

https://mui.com/x/react-date-pickers/date-calendar/#dynamic-data

We use this functionality to mark days with missing data, but we would like to mark also on "month" and "year" view.
What would be best way to do it?

Your environment 🌎

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@andrejremic andrejremic added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Sep 25, 2023
@LukasTy
Copy link
Member

LukasTy commented Sep 25, 2023

Hello, thank you for creating this issue.
We do not expose any of the year or month calendar slots, hence, it's not that trivial to override only parts of it.
Currently I see two options:

  • Try working around with styles and applying custom styling to the certain nth-element, like in this example.
  • Override the whole viewRenderer with your custom DateCalendar view renderer. But it would be a massive chore to override it for just those small mentioned portions. 🙈

Let me know if using custom styles would help you.
I'm moving this issue to our board and in the process for grooming as we can definitely improve in this regard and expose more portions as slots. 👍

@LukasTy LukasTy added component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 25, 2023
@LukasTy LukasTy changed the title [question] Date-calendar - Dynamic data - mark months, years [pickers] Customize MonthCalendar and YearCalendar slots Sep 25, 2023
@jansepke
Copy link

jansepke commented May 6, 2024

this might now be a duplicate of #10874 (which has more upvotes) but to answer @LukasTy question: using custom styles are not enough because we want to have different styles for the current year, selected year and hovered year. this is not really possible with the currently available selectors.

So adding more classes or adding slots for YearPicker would really help 👍

@LukasTy
Copy link
Member

LukasTy commented May 17, 2024

@jansepke thank you for investigating and taking the time to reply.
It looks like those issues are essentially duplicates.
I'm closing this one in favor of the more upvoted one and bumping its priority for grooming to high. 😉

@LukasTy LukasTy closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Copy link

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@andrejremic: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature support: commercial Support request from paid users
Projects
None yet
Development

No branches or pull requests

3 participants