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

[DateRangePicker] Support month and year edition on the range pickers #4546

Open
jinqiangg opened this issue Nov 3, 2021 · 16 comments
Open
Assignees
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer new feature New feature or request plan: Pro Impact at least one Pro user

Comments

@jinqiangg
Copy link

jinqiangg commented Nov 3, 2021

Correct me if I miss out anything. While using DateRangePicker on v5, I am unable to do a quick selection to change year / month. Have to manually click on the < or > button. Understand that the range design with the intend of selecting recent dates but I do have use case that requires users to select date from years ago.

Summary 💡

Allow selection of year or month upon clicking the month / year.

Examples 🌈

SCR-20241015-mutw

Motivation 🔦

@jinqiangg jinqiangg added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 3, 2021
@mnajdova

This comment was marked as resolved.

@mnajdova

This comment was marked as resolved.

@mnajdova mnajdova added component: DateRangePicker The React component. support: question Community support but can be turned into an improvement and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 3, 2021
@oliviertassinari oliviertassinari removed the support: question Community support but can be turned into an improvement label Nov 29, 2021
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 29, 2021

Same pain point as in mui/material-ui-pickers#1769. I don't what what we should do, let's leave it to X.

@socramm9
Copy link
Contributor

socramm9 commented Mar 8, 2022

It would be maybe also nice to have a MonthRangePicker and YearRangePicker for the time being I will use tow DatePickers with month/year views

@cherniavskii cherniavskii transferred this issue from mui/material-ui Apr 18, 2022
@cherniavskii cherniavskii added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 18, 2022
@flaviendelangle flaviendelangle changed the title DateRangePicker select Year/Month [DateRangePicker] select Year/Month Apr 25, 2022
@joserodolfofreitas joserodolfofreitas added the plan: Pro Impact at least one Pro user label Apr 25, 2022
@alexfauquette alexfauquette added the new feature New feature or request label May 12, 2022
@cherniavskii cherniavskii added component: pickers This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 24, 2022
@oliviertassinari
Copy link
Member

It would be maybe also nice to have a MonthRangePicker and YearRangePicker for the time being I will use tow DatePickers with month/year views

@socramm9 Is this #4995 what you are referring to?

@socramm9
Copy link
Contributor

@socramm9 Is this #4995 what you are referring to?

Yes I build something similar myself now. It is not perfect and has some other issues but here some Images for Inspiration
Bildschirmfoto 2022-05-29 um 21 54 11
Bildschirmfoto 2022-05-29 um 21 54 02
Bildschirmfoto 2022-05-29 um 21 53 42

@vazkir
Copy link

vazkir commented Jul 15, 2022

@socramm9 Do you by any chance have any example on how you achieved this?

@socramm9
Copy link
Contributor

@vazkir Yes it not up to MUI standards but its usable. Fell free to modify it however you want

https://codesandbox.io/s/busy-babycat-96jksl

@cube-dan
Copy link

cube-dan commented Apr 18, 2023

@socramm9 You're my hero ... pulled it down, turned it into a component, can’t stop smiling.

Thanks SO much for posting your solution!

@LukasTy LukasTy added the v7.x label Jul 3, 2023
@plgagnon2
Copy link

plgagnon2 commented Jul 26, 2023

Particularly need this for analytics/statistics application...

@bruns6077
Copy link

https://material.angular.io/components/datepicker/overview

does handle this also pretty well, might be something for inspiration

@LukasTy
Copy link
Member

LukasTy commented Aug 6, 2024

We agreed to first add support for changing year and month views in a similar way to how Angular Material does it.

With a limitation of only supporting it when calendars={1}.
If the calendars prop is not overridden by the user, we would default it to 1 if views has year or month entries.
Here is the issue for enhancing the behavior to add the missing behavior: #14119.

This does not impact anything related to picking the month and year ranges.

@gabbi-pf
Copy link

gabbi-pf commented Oct 8, 2024

Hello, we reported #14874, sorry for the duplicate but we couldn't find this one when we searched for issues. Should this, and #14119, now be marked with plan: premium?
Also, is there an estimate on when support for year and month view will be implemented? I see this issue being opened 3 years ago, and we will need to find another solution if this functionality isn't supported in the near future. We understand you get a million requests like these and have to prioritize, but we need to evaluate other solutions if this is not implemented soon. 🫤

Duplicates #4546

You can find this issue to track our advancement on the topic, this is not yet supported but we plan to add support for it at some point

@vaneri
Copy link

vaneri commented Oct 10, 2024

@LukasTy do you think that you could help on this particular topic? / it would be great to know if there is at least a plan for it
thanks!

@flaviendelangle flaviendelangle added plan: Premium Impact at least one Premium user and removed plan: Pro Impact at least one Pro user labels Oct 14, 2024
@flaviendelangle
Copy link
Member

@gabbi-pf I added the requested label 👍

We don't plan to support it in the new feature because we have a very heavy roadmap for the coming months.

@DimitarKazakov
Copy link

I managed to make a workaround using DateRangeCalendar for the range selection and DateCalendar for the year and month selection. I am posting part of my code here if anyone still needs the component. Ignore the styles and the customization, the important part to look at is the monthYearView state, the dateRangeCalendarProps ref and how i am using DateCalendar and DateRangeCalendar with the custom calendarHeader. PS: i am new to posting in github discussions

Screen.Recording.2025-01-31.at.18.07.19.mov

code.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer new feature New feature or request plan: Pro Impact at least one Pro user
Projects
Status: Next in queue
Development

No branches or pull requests