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(range-calendar): hide only dates outside the month #2906

Merged
merged 4 commits into from
Apr 29, 2024
Merged
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
6 changes: 6 additions & 0 deletions .changeset/nasty-pillows-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/calendar": patch
"@nextui-org/theme": patch
---

Fixed hiding of unavailable dates in RangeCalendar (#2890)
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the spelling mistake in the changeset description.

- Fixed hiding of unavailable dates in RangeCalendar (#2890)
+ Fixed hiding of unavailable dates in RangeCalendar (#2890)

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Fixed hiding of unavailable dates in RangeCalendar (#2890)
Fixed hiding of unavailable dates in RangeCalendar (#2890)

2 changes: 1 addition & 1 deletion packages/components/calendar/src/calendar-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function CalendarCell(originalProps: CalendarCellProps) {
ref,
);

const isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;
const isUnavailable = state.isCellUnavailable(props.date);
const isLastSelectedBeforeDisabled =
!isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({days: 1}));
const isFirstSelectedAfterDisabled =
Expand Down
2 changes: 1 addition & 1 deletion packages/core/theme/src/components/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const calendar = tv({
},
hideDisabledDates: {
true: {
cellButton: "data-[disabled=true]:opacity-0",
cellButton: "data-[disabled=true]:data-[outside-month=true]:opacity-0",
},
false: {},
},
Expand Down
Loading