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.91k stars 1.19k forks source link

[pickers] Smart format for date range #8588

Open CountrySmooth opened 1 year ago

CountrySmooth commented 1 year ago

For SingleInputDateRangeField can we have a smart format for when the range is in the same year and month that we can display the value like 14 - 27 Apr 2023 rather than 14⁩ ⁦Apr⁩ ⁦2023⁩ – ⁦27⁩ ⁦Apr⁩ ⁦2023

flaviendelangle commented 1 year ago

Hi,

No, that's not something we support, and it would be a major change to support it. One thing we would like to add in the future is to be able to disable smartly some sections (like you can see for the month and year on the native date input).

Once we have that, we could imagine providing a lower level API letter people disable some sections themselves.

But changing the rendered sections would be complicated because it would break the parsing of the date, which we are not responsible for.