Skip to content

How does the a-date-picker component control the unselectable year? #3810

@easy-mj

Description

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

Version

1.6.4

Environment

MacOS,版本 88.0.4324.146(正式版本) (x86_64),2.6.11

Reproduction link

https://antdv.com/components/date-picker-cn/

Steps to reproduce

  • 使用组件
<a-date-picker
:mode="mode"
:open="startYear.open"
:disabled-date="disabledYearStartDate"
@openChange="onStartYearOpenChange"
@panelChange="onStartYearPanelChange"
v-decorator="decorators.start_time"
format="YYYY" />
  • 定义禁用处理方法
disabledYearStartDate (current) {
console.log(current.year(), this.$moment().year())
return current && current.year() < this.$moment().year()
},

What is expected?

可以正常对当前年份之前的年份实现禁用

What is actually happening?

禁用无效

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions