Skip to content

Commit

Permalink
fix(range-calendar): hide only dates outside the month (#2906)
Browse files Browse the repository at this point in the history
* fix(range-calendar): hide only dates outside the month #2890

* fix(range-calendar): corrected spelling mistake in changeset description

* fix(range-calendar): corrected capitalization in changeset description

* chore(changeset): patch @nextui-org/theme

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
  • Loading branch information
3 people committed Apr 29, 2024
1 parent 6aacde2 commit c83ff38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
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)
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 c83ff38

Please sign in to comment.