mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.92k stars 1.2k forks source link

[CalendarPicker] Add prop `showFixedNumberOfWeeks` #5387

Closed InFuz closed 1 year ago

InFuz commented 3 years ago

I would like to be able to set a property showFixedNumberOfWeeks for Datepicker.

Summary 💡

showFixedNumberOfWeeks - whether to always show fixed number (6) of weeks, regardless of the number of days and weeks in a month. By analogy with how it is done in the react-calendar library.

type = boolean; default value = false;

Examples 🌈

showFixedNumberOfWeeks = true; // There will always be 6 weeks in the Calendar block. Screenshots of the expected behavior:

Снимок экрана 2021-03-30 в 17 20 18

Motivation 🔦

  1. It is convenient that the block with the calendar always has a fixed height and there are no cases when an empty space remains at the bottom of the calendar.
  2. You can also quickly jump to the first days of the next month if they appear in the current month overview.
mnajdova commented 3 years ago

I'd say we should we wait for upvotes on this one? What do you think @oliviertassinari @eps1lon?

oliviertassinari commented 3 years ago

I have seen a fixed number of weeks as the default or an existing option in:

There is also another topic bundled in this discussion: the display of days from another month: mui/mui-x#6494.

flaviendelangle commented 2 years ago

@joserodolfofreitas if you want to prioritize this one