-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Allow showing only the selected week numbers on the DateRangePicker text field #10823
Comments
Hello, this looks like the same problem as #10279 |
When talking about supporting the week number token, it'd be a feature on its own, but when talking about supporting formats only consisting of escaped characters, it would indeed be the same as #10279. I have explored the example in the proposed change. Essentially what this does is adding support for a function to generate the shown value, is that correct? If that's the case, this would also be sufficient for our use case. |
The mentioned change basically adds the option to have a field without any interactive sections (empty). |
I see. I believe this would indeed cater for our use case. |
Thanks for letting us know. Please feel free to re-open this issue or create a new one if the provided solution is not sufficient. 😉 |
Summary 💡
We are using the
DateRangePicker
component and would like to show the selected week numbers only. For example, when selecting the last three weeks of December, it should show50 - 52
. Our users are interested in selecting entire weeks, which we have achieved by using theshouldDisableDate
function, so they are also only interested in seeing the selected week numbers in the text field.We are using
moment
andAdapterMoment
on ourLocalizationProvider
and according to moment's format documentation,w
should be used as a token to get the week number. However, this does not work in theDateRangePicker
. We have considered calculating the weeks ourselves and putting it in an escaped string, such as[50 - 52]
, but only specifying an escaped string isn't supported as seen in this issue and from personal experience.This CodeSandbox can be used to reproduce the issue. When changing the format to for example
DD
, it does indeed show the day number, butw
doesn't work to show the week number.Could the tokens be expanded so we can also show the selected week number(s)?
Examples 🌈
Motivation 🔦
The lack of this feature doesn't allow us to give our users only the information they are interested it.
Search keywords: daterangepicker weeknumbers
The text was updated successfully, but these errors were encountered: