Skip to content

Commit

Permalink
X2-6916 Datepicker for same day shows text in white (v2.1.15) (#264)
Browse files Browse the repository at this point in the history
* X2-6916 Datepicker for same day shows text in white (v2.1.15)

* X2-7088: Revert changes which are breaking selenium

* Revert changes for isSameDay

* X2-6916: Fix selenium failures

* Update src/components/DatePicker/DatePicker.jsx

* lint fix

* added comment

---------

Co-authored-by: Tanushree Chakravarty <[email protected]>
Co-authored-by: Rushi Vishavadia <[email protected]>
  • Loading branch information
3 people authored Sep 19, 2023
1 parent 207320c commit 7cb0dcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/DatePicker/DatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ 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();
// Return the same value if it is already dayjs object or has range variant otherwise format it to dayJs object
const selectedDays = dayjs.isDayjs(value) || isRangeVariant ? value : dayjs(value).toDate();

return (
<>
Expand Down Expand Up @@ -189,7 +191,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 7cb0dcf

Please sign in to comment.