Skip to content

🐛 Fix EndDatePicker selection range progress #5619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/day.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ export default class Day extends Component<DayProps> {
if (
selectsEnd &&
startDate &&
!endDate &&
(isAfter(selectingDate, startDate) || isEqual(selectingDate, startDate))
) {
return isDayInRange(day, startDate, selectingDate);
Expand Down
29 changes: 0 additions & 29 deletions src/test/datepicker_test.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3153,35 +3153,6 @@ describe("DatePicker", () => {
).toBe(true);
}
});

it("should not apply '--in-selecting-range' class to the days till the date that matched selectedDate in the next months (endDatePicker)", () => {
const startDay = 3;
const endDay = 8;
const startDate = new Date(`2025/02/${startDay}`);
const endDate = new Date(`2025/02/${endDay}`);

const { container } = render(
<DatePicker
inline
selectsEnd
startDate={startDate}
endDate={endDate}
minDate={startDate}
/>,
);

goToNextMonth(container);

for (let i = 1; i <= endDay; i++) {
const inSelectionRangeDay = safeQuerySelector(
container,
`.react-datepicker__day--00${i}`,
);
expect(
inSelectionRangeDay.classList.contains(IN_RANGE_DAY_CLASS_NAME),
).toBe(false);
}
});
});

describe("selectsRange without inline", () => {
Expand Down
Loading