ElemeFE / ElemeFE/element

[Feature Request] 日期选择器 如何实现 不能跨越禁用日期 进行范围选择功能

Open
#21,720 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Existing Component

### Component Name
DatePicker

### Description
现在我通过pickerOptions的disabledDate 功能实现了 对日期的禁用
现在禁用了 2022-02-16 到 2022-02-18 ,
一切看起来都没有问题, 不过当我开始选择时, 点击了一个可点的日期 例如 2022-02-15
然后我又点击了一下2022-02-19 这样却可以完成选择, 其中的时间我设置了不可点击, 但是现在却还是可以选中这段时间范围

我希望 不让用户选择上我已经设置为不可选择的日期, 即 用户点击第一个日期后, 下一个日期只能点击距离不能点击日期的最近的时间, 就是不能跨越禁用时间进行选择!

(实际业务中, 这段不可选择的日期已经做了其他事情, 这个时间别人就无法使用了)

![image](https://user-images.githubusercontent.com/45815935/155120350-d9cc42d5-d4f5-45e0-bf4a-f3e43f6c267d.png)
![image](https://user-images.githubusercontent.com/45815935/155120572-a5482f54-4787-4a2f-9d57-1ee67c0257b7.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.