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

[DatePicker] Add possibility to customize particular days #3794

Closed
izziaraffaele opened this issue Mar 24, 2016 · 2 comments
Closed

[DatePicker] Add possibility to customize particular days #3794

izziaraffaele opened this issue Mar 24, 2016 · 2 comments
Labels
component: date picker This is the name of the generic UI component, not the React module!

Comments

@izziaraffaele
Copy link
Contributor

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...

@mbrookes
Copy link
Member

@izziaraffaele #3739 is fixing layout, not trying to fix every DatePicker bug and add every feature requested. 😄

@mpontikes mpontikes mentioned this issue Aug 5, 2016
13 tasks
@oliviertassinari oliviertassinari added the component: date picker This is the name of the generic UI component, not the React module! label Oct 19, 2016
@oliviertassinari
Copy link
Member

Closing for #4787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date picker This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants