Skip to content

🐛 [Bug]: Calendar 组件在 range 模式且设置maxDate下无法选中maxDate的那天 #758

@mclryan

Description

@mclryan

Which React Vant packages are impacted?

  • react-vant (React Vant core)
  • react-vant-icons(React Vant Icon)

What version of React Vant are you using?

3.3.5

Reproduce live demo(codesandebox or stackblitz)?

No response

Descripition

复现步骤

  1. 设置 Calendar 组件为 range 模式
  2. 启用 allowSameDay
  3. 设置maxDate
  4. value设置maxDate那天作为开始和结束日期
  5. 组件显示的状态并不是选中在同一天,期望选中同一天,只有在value为maxDate那天的时候才会复现,其他是正常的

最小复现代码

<Calendar
type="range"
allowSameDay
showConfirm={false}
poppable={false}
minDate={new Date(2024,1,1)}
maxDate={new Date(2025,0,2)}
value={[new Date(2025,0,2), new Date(2025,0,2)]}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions