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 06d32d9 commit dbd5f05
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 dbd5f05

Please sign in to comment.