ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

a-date-picker使用valueFormat属性后使用disabled-date第一次失效

Open Libpzzz opened this issue 1 year ago • 3 comments
trafficstars

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

Version

undefined

Environment

vue版本

Reproduction link

https://gitee.com/libinpeng/ant.git

Steps to reproduce

先选择第一个日期,看第二个日期的禁选日期,选第二个日期的时候会发现禁选日期又一次改变了

What is expected?

我希望第二个时间的禁选日期根据第一个时间改变而改变

What is actually happening?

初始时第一个时间改变时第二个禁选日期有问题,当我第一次进来时选择第一个时间为2024-02-15,第二个时间应该是只能选2024-02-17以及以后的日期,但是还是可以选2024-02-16且选完之后那个日期被禁选了

Libpzzz avatar Feb 04 '24 09:02 Libpzzz

尝试把valueFormat改为"YYYY-MM-DD 00:00:00"

qppq54s avatar Feb 05 '24 01:02 qppq54s

尝试将 valueFormat 改为“YYYY-MM-DD 00:00:00”

感谢,确实能够成功实现,但是还有其他方法吗?因为我想要的格式的YYYY-MM-DD

Libpzzz avatar Feb 05 '24 02:02 Libpzzz

尝试将 valueFormat 改为“YYYY-MM-DD 00:00:00”

我看你的回答,猜测antd比较的方法,发现我将前后比较的格式统一就可以实现,于是我将比较的参数都改为YYYY-MM-DD的时间戳 let currentDate = new Date(flightInfoForm.value.expectedArrival); currentDate = currentDate.setDate(currentDate.getDate() + 1); const newCurrent = dayjs(current.format('YYYY-MM-DD')).valueOf(); return newCurrent && newCurrent < currentDate;

Libpzzz avatar Feb 05 '24 02:02 Libpzzz

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Apr 06 '24 02:04 github-actions[bot]