calendar icon indicating copy to clipboard operation
calendar copied to clipboard

disabledMonth & disabledYear - similar to disabledDate

Open Matiszak opened this issue 5 years ago • 3 comments

Hi, I'd like to propose feature request that I think would be beneficial:

currently we can select which dates can be disabled (grayed out) by providing disabledDate function.

I prose to introduce similar functions disabledMonth and disabledYear to allow rc-calendar to disable(grey out) mongths/years on month/year selection panels. Currently I'm thinking about implementing this for single and range calendar.

If such feature request gets approved I'm willing to create a PR with such a feature.

Matiszak avatar Mar 11 '19 08:03 Matiszak

Current situation I'd say is more like a bug. From example: we pass disabledDate to allow dates from now to the future but we can still pick previous month/year/decade from now.

I think we can achive that what your saying using just disabledDate function. I did it for single calendar only, tests failed on range calendar.

Let me know what do you think, is it a good way we could follow? https://github.com/react-component/calendar/pull/564

arolonger avatar May 07 '19 18:05 arolonger

@zombieJ what do you think about @arolonger solution ?

Matiszak avatar May 30 '19 07:05 Matiszak

Maybe disable year / month when disabledDate provided is better. You can continue work with this.

But since Ant Design 4.0 with rewrite DatePicker design style, it may do some refactor or rewrite work on rc-calendar at Q4. Just notice here, in case out of sync.

zombieJ avatar Jun 03 '19 01:06 zombieJ