Skip to content

RangePicker bug, unexpect year disabled when i set disabledDate except for the past year #27517

Closed
react-component/picker
#191
@balanceXLR

Description

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

i set the disabledDate like this

function disabledDate(current) {
  return (
    current >= moment().startOf("day") ||
    current < moment().subtract(1, "years")
  );
}
  1. focus rangePick and click year button 1
  2. all the years are disabled 2

What is expected?

years and month in range are not disabled

What is actually happening?

all the year are disabled

Environment Info
antd 4.8.0
React 16.13.1
System macos
Browser chrome 86.0.4240.111

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions