Material-ui: [DatePicker] Allow to customize the rendered month

Created on 10 Jul 2019  路  5Comments  路  Source: mui-org/material-ui

Is there any possibility of an implementation of a renderMonth function? This would work very similarly to how the renderDay function works, although allowing custom rendering for different selected months.

Capture d鈥檈虂cran 2020-11-15 a虁 00 02 13

https://next.material-ui.com/components/date-picker/#views-playground

Your Environment 馃寧

| Tech | Version |
| ----------- | ------- |
| @material-ui/lab | v5.0.0-alpha.16 |

DatePicker enhancement

Most helpful comment

I think I need the same, from my point of view, we could try a render prop here https://github.com/mui-org/material-ui-pickers/blob/fd86dc2daa19ee8d85240b170000c29c6c5cb54a/lib/src/views/Calendar/Month.tsx#L70
To be possible to add more components in month rendering, like it's possible with renderDay.

All 5 comments

Yes it could be usefull in order to implement quarter selection.

Do you have more details on the end result you wish to accomplish with such a feature?

I think I need the same, from my point of view, we could try a render prop here https://github.com/mui-org/material-ui-pickers/blob/fd86dc2daa19ee8d85240b170000c29c6c5cb54a/lib/src/views/Calendar/Month.tsx#L70
To be possible to add more components in month rendering, like it's possible with renderDay.

Thanks for opening this issue. I agree, It seems that we would benefit from more customization power. We will have the same problem to solve on the more advanced components that can't allow a composition API. Moving the discussion around the API to https://github.com/mui-org/material-ui/issues/21453.

At this point, I think that we could consider having a shared component to display:

  • Years
  • Quarters
  • Months

I fail to envision why we would need a different component for each.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anthony-dandrea picture anthony-dandrea  路  3Comments

newoga picture newoga  路  3Comments

FranBran picture FranBran  路  3Comments

reflog picture reflog  路  3Comments

ericraffin picture ericraffin  路  3Comments