-
-
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
[DateRangePicker] Day component not supporting DateRange some props #4566
Comments
@bneigher Awesome feedback, thanks for raising. I have updated your codesandbox to work with the latest version: https://codesandbox.io/s/strange-dirac-pcplh. We have started to surface the problem in mui/material-ui-pickers#2006. We have two different components internally PickersDay and PickersDayRange, and yet we have the same prop I think that we should differentiate the two. I believe the RFC in: mui/material-ui#21453 will solve this problem. <DateRangePicker components={{ Day: PickersDay, DayRange: PickersDayRange }} So that @bneigher can use the same custom PickersDay component between day and day ranges. |
Any progress on this one? I couldn't either import PickersDayRange. Looks like we do not expose that: import { PickersDayRange } from '@material-ui/pickers'; I noticed this is tagged for v5 but is there a chance we could just expose PickersDayRange in the library for now? I think that would help a lot at least for minor customizations like basic css. Right now I am really blocked by this one, and I would just like to add background to some specific days I am using 4.0.0-alpha.12 version of the lib Thanks a lot for the excellent library btw! |
I am facing the same issue, I want to add some custom elements to the calendar days, but without messing with the selection (which is awesome BTW). I'm using the lab version v5.0.0-alpha.17, and getting the same warnings as @bneigher. Keep up the great work and thank you for providing us with this awesome library! |
Still an issue with |
The component used to render days inside DateRangePicker can now be imported as import { DateRangePickerDay } from '@mui/x-date-pickers-pro'; CodeSandbox: https://codesandbox.io/s/ancient-silence-zmpd5p?file=/src/demo.jsx Docs: https://mui.com/x/react-date-pickers/date-range-picker/#customized-day-rendering We plan to migrate the API to a slot approach, same as the DataGrid, so I'll close this one in favor of #4466 |
I'm implementing a custom Day UI to live in the DateRange picker. It looks like this:
![Screen Shot 2020-07-15 at 12 29 42 PM](https://user-images.githubusercontent.com/4627728/87587431-ece44b80-c696-11ea-9f37-7f4c4adf315c.png)
You can see that in this date range, none of the IN RANGE days are highlighted, which is odd.
I'm seeing some errors in the console:
Which leads me to believe that some of the date range props are not supported in the Day component.
Current Behavior 😯
Day component not rendering isHighlighting days in the date range
Expected Behavior 🤔
Day range should render highlighted zone correctly as it does without specifying the custom
![Screen Shot 2020-07-15 at 12 35 12 PM](https://user-images.githubusercontent.com/4627728/87587949-b3601000-c697-11ea-8648-d3396b8a0845.png)
renderDay
method:Here is a simplified version of a
renderDay
with shows issueSteps to Reproduce 🕹
https://codesandbox.io/s/headless-sun-ig04d
Your Environment 🌎
The text was updated successfully, but these errors were encountered: