plotly / dash-core-components

OBSOLETE: now part of https://github.com/plotly/dash
https://dash.plotly.com
MIT License
270 stars 146 forks source link

Disable multiple dates/date types in dcc.DatePicker* #126

Open radumas opened 6 years ago

radumas commented 6 years ago

I'll open this here but I am aware that you're using AirBnB's react-dates so I'll start here and then open an issue there if it's not something that can be implemented on the dash side.

We'd like to disable "categories" of days from being selected. Our smallest request would be disabling weekdays or weekends, but generally supplying a list of available dates or unavailable dates to the DatePicker would be :+1:

chriddyp commented 6 years ago

Thanks for reporting @radumas !

On a quick glance, it looks like maybe isDayBlocked is the property to use here. The DatePickers would need to convert that property (which is a function) into something that can be serialized as JSON, like a list of dates and/or a pattern of dates

radumas commented 6 years ago

So something like this/these React examples? https://github.com/airbnb/react-dates/blob/57fce50fa1f8f8b2e099ea1d2219904a1c1774c7/stories/SingleDatePicker_day.js

slowmountain commented 6 years ago

Hi! Any updates on this? Supplying a list of unavailable dates would be very helpful for me as well.

yakneens commented 6 years ago

+1 This would be a good property from the base component to expose in Dash. It would be nice to be able to provide a list or a function that's called on each date to tell if it's blocked. I think that's how it works in the base React component.

byronz commented 5 years ago

see if it fits in #600

radupm commented 3 years ago

Any updates / plans for this? I hope it won't be ignored (since it's >2yrs ago). I was also missing this feature in several places. Had to use dcc.Dropdown as an alternative, which is a pity, considering this is based on react-dates which already has this prop available.

SimonKnorke commented 3 years ago

Hi, I would also be excited to see an update to this feature. Having an interface to the DatePicker to disable or mark individual dates would be really useful.

RunQi-Han commented 2 years ago

With Dash 2.0, this feature is available now. @SimonKnorke @radupm

cedro-gasque commented 2 years ago

@RunQi-Han Is there documentation anywhere on this? I can't find a pull request for it, nor is it mentioned in the documentation or shows up in the github repo as far as I can tell.

RunQi-Han commented 2 years ago

@RunQi-Han Is there documentation anywhere on this? I can't find a pull request for it, nor is it mentioned in the documentation or shows up in the github repo as far as I can tell.

@cedro-gasque https://github.com/plotly/dash/releases

cedro-gasque commented 2 years ago

@RunQi-Han this link does not say anything about pattern matching. It doesn't even mention the Date Picker. The last update I can find for the Date Picker was the addition of the disabled_days property, before Dash 2.0 even came out.

RunQi-Han commented 2 years ago

@RunQi-Han this link does not say anything about pattern matching. It doesn't even mention the Date Picker. The last update I can find for the Date Picker was the addition of the disabled_days property, before Dash 2.0 even came out.

@cedro-gasque isn't this one? https://github.com/plotly/dash-core-components/pull/948

etiennecelery commented 2 years ago

This would be awesome, as many applications are used in work environments where usually there are no movements at the weekends, so one could disable the option.