Skip to content

Commit

Permalink
fix(range-calendar): hide only dates outside the month nextui-org#2890
Browse files Browse the repository at this point in the history
  • Loading branch information
shrinidhi.upadhyaya committed Apr 28, 2024
1 parent 1a033fe commit 4cc7ed4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-pillows-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/calendar": patch
---

Fixed hiding of Unvavailable 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

0 comments on commit 4cc7ed4

Please sign in to comment.