Skip to content

Commit

Permalink
Date picker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blkr4 committed Sep 12, 2023
1 parent c3c09b3 commit 22827e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/DatePicker/DatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const DatePicker = ({

// Comparing `from` and `to` dates hides a weird CSS style when you select the same date twice in a date range.
const useDateRangeStyle = isRangeVariant && value.from?.getTime() !== value.to?.getTime();
const selectedDays = isDayjs(value) ? value : dayjs(value).toDate();

Check failure on line 144 in src/components/DatePicker/DatePicker.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

src/components/DatePicker/DatePicker.jsx#L144

[no-undef] 'isDayjs' is not defined.

return (
<>
Expand Down Expand Up @@ -189,7 +190,7 @@ export const DatePicker = ({
modifiers.waitlist ? "has-custom-content" : null,
)}
todayButton={variant === "single" ? "Today" : undefined}
selectedDays={value}
selectedDays={selectedDays}
month={currentMonth}
modifiers={{ ...modifiers, ...rangeModifier }}
numberOfMonths={isRangeVariant ? 2 : 1}
Expand Down

0 comments on commit 22827e6

Please sign in to comment.