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: the disabled dates in the n-date-picker can still be triggered #6515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Fixes

- Fix `n-time-picker`'s `use-12-hours` type error warning, closes [#4308](https://github.com/tusen-ai/naive-ui/issues/4308)
- Fix the problem that the disabled dates in the `n-date-picker` can still be triggered, closes [#6503](https://github.com/tusen-ai/naive-ui/issues/6503)

### Features

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Fixes

- `n-time-picker` 的 `use-12-hours` 类型错误警告,关闭 [#4308](https://github.com/tusen-ai/naive-ui/issues/4308)
- 修复 `n-date-picker` 禁用的日期还可以触发的问题,关闭 [#6503](https://github.com/tusen-ai/naive-ui/issues/6503)

### Features

Expand Down
2 changes: 2 additions & 0 deletions src/date-picker/src/panel/use-dual-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ function useDualCalendar(
}
// for daterange & datetimerange
function handleDateClick(dateItem: DateItem): void {
if (mergedIsDateDisabled(dateItem.ts))
return
if (!isSelectingRef.value) {
isSelectingRef.value = true
memorizedStartDateTimeRef.value = dateItem.ts
Expand Down
Loading