Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
Libpzzz opened this issue Feb 4, 2024 · 4 comments
Closed
1 task
Labels

Comments

@Libpzzz
Copy link

Libpzzz commented Feb 4, 2024

  • 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且选完之后那个日期被禁选了

@qppq54s
Copy link

qppq54s commented Feb 5, 2024

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

@Libpzzz
Copy link
Author

Libpzzz commented Feb 5, 2024

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

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

@Libpzzz
Copy link
Author

Libpzzz commented Feb 5, 2024

尝试将 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;

Copy link

github-actions bot commented Apr 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants