dash-core-components icon indicating copy to clipboard operation
dash-core-components copied to clipboard

Disable multiple dates/date types in dcc.DatePicker*

Open radumas opened this issue 7 years ago • 13 comments

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:

radumas avatar Dec 12 '17 19:12 radumas

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

chriddyp avatar Dec 12 '17 19:12 chriddyp

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

radumas avatar Dec 12 '17 20:12 radumas

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

slowmountain avatar May 31 '18 13:05 slowmountain

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

yakneens avatar Jul 25 '18 08:07 yakneens

see if it fits in #600

byronz avatar Aug 08 '19 20:08 byronz

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.

radupm avatar Sep 30 '20 08:09 radupm

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.

SimonKnorke avatar Jun 16 '21 08:06 SimonKnorke

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

RunQi-Han avatar Oct 28 '21 17:10 RunQi-Han

@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 avatar Nov 03 '21 23:11 cedro-gasque

@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

RunQi-Han avatar Nov 04 '21 13:11 RunQi-Han

@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 avatar Nov 09 '21 19:11 cedro-gasque

@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

RunQi-Han avatar Nov 10 '21 21:11 RunQi-Han

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.

etiennecelery avatar Dec 07 '21 16:12 etiennecelery