Skip to content

Commit

Permalink
🏷️(react) fix types issue
Browse files Browse the repository at this point in the history
Since upgrade of @react-stately/calendar, a type issue was emit and
broke the build.
  • Loading branch information
jbpenrath committed Jul 29, 2024
1 parent 0c81dfd commit 0850fcd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/react/src/components/Forms/DatePicker/CalendarCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface CalendarCellProps {
}

const isRangeCalendar = (object: any): object is RangeCalendarState => {
return object?.highlightedRange;
return Boolean(object?.highlightedRange);
};

export const CalendarCell = ({ state, date }: CalendarCellProps) => {
Expand All @@ -31,15 +31,15 @@ export const CalendarCell = ({ state, date }: CalendarCellProps) => {
} = useCalendarCell({ date }, state, ref);

const isSelectionEnd =
isRangeCalendar(state) && isSameDay(date, state?.highlightedRange?.end);
isRangeCalendar(state) && isSameDay(date, state.highlightedRange!.end);

const isSelectionStart =
isRangeCalendar(state) && isSameDay(date, state?.highlightedRange?.start);
isRangeCalendar(state) && isSameDay(date, state?.highlightedRange!.start);

const isWithinHighlightedRange =
isRangeCalendar(state) &&
state?.highlightedRange?.start <= date &&
state?.highlightedRange?.end >= date;
state?.highlightedRange!.start <= date &&
state?.highlightedRange!.end >= date;

return (
<td {...cellProps}>
Expand Down

0 comments on commit 0850fcd

Please sign in to comment.