A callback just like shouldDisableDate() to render each day of the calendar would solve the issue and make the DatePicker much more flexible.
This callback ( ex getDayElement() ) must always return a DayButton instance and it's set internally by default. If the callback is passed by props, then the internal callback will be overwritten so that developer can return a customized instance of DayButton from the parent component.
This can also replace completely shouldDisableDate() callback as the developer can set the disable state directly on the DayButton component.
var myDayGetter = function(day){
// do something with day
return <DayButton disabled date={day} style={...} />
}
<DatePicker getDayElement={myDayGetter}/>
I see that you're redesigning the component here #3739 so if you like the idea we could integrate it with that...
A callback just like shouldDisableDate() to render each day of the calendar would solve the issue and make the DatePicker much more flexible.
This callback ( ex getDayElement() ) must always return a DayButton instance and it's set internally by default. If the callback is passed by props, then the internal callback will be overwritten so that developer can return a customized instance of DayButton from the parent component.
This can also replace completely shouldDisableDate() callback as the developer can set the disable state directly on the DayButton component.
I see that you're redesigning the component here #3739 so if you like the idea we could integrate it with that...