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

fix(RangePicker):设置disabled={[true, false]} 并且同时设置 disabledDate={(current) => current && current < dayjs().startOf('day')},endDate无法修改 #846

Closed
wants to merge 0 commits into from

Conversation

Zyf665
Copy link

@Zyf665 Zyf665 commented Jul 17, 2024

中文版模板 / Chinese template

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

fix ant-design/ant-design#49617

💡 Background and solution

fix:ant-design/ant-design#49617

📝 Changelog

Language Changelog
🇺🇸 English fix:ant-design/ant-design#49617
🇨🇳 Chinese 修复:ant-design/ant-design#49617

Copy link

vercel bot commented Jul 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
picker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2024 3:08am

@@ -270,9 +270,9 @@ export default function useRangeValue<ValueType extends DateType[], DateType ext
// >>> Invalid
const validateDates =
// Validate start
(!start || !isInvalidateDate(start, { activeIndex: 0 })) &&
(!start || !isInvalidateDate(start, { activeIndex: 0 }) || disabled[0]) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能这么做,disabled 应该拦截才对。感觉可以加个 warning 告知当前的 disabled 的时间被 disabledDate 拦截了

@kagawagao
Copy link

kagawagao commented Jul 25, 2024

这里 API 设计是否可以考虑在 RangePickerdisabledDate 也支持传入数组,分别控制开始时间和结束时间

或者说像 disabledTime 一样,区分 start/end

image

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