Skip to content

fix(DayRangePicker3): Fixed being able to get out of bounds in non contiguous mode #7277

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 4 commits into from
Feb 26, 2025

Conversation

jscheiny
Copy link
Contributor

@jscheiny jscheiny commented Feb 26, 2025

Fixes #7267

Changes proposed in this pull request:

Fixed an issue that would allow users to get out of bounds by moving to an invalid month in a different year and then changing to that year. For example, if the max date is March 2024, you can switch to May 2023 and then change the year to 2024 and result in a broken state. This works in both directions for min and max dates.

Some minimal repros include:

<DateRangeInput3
    contiguousCalendarMonths={false}
    minDate={new Date(2024, 3, 1)}
/>
<DateRangeInput3
    contiguousCalendarMonths={false}
    maxDate={new Date()}
/>

@svc-palantir-github
Copy link

fix(DayRangePicker3): Fixed being able to get out of bounds

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@jscheiny jscheiny marked this pull request as ready for review February 26, 2025 02:14
@svc-palantir-github
Copy link

Format

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

minDate: Date | undefined,
maxDate: Date | undefined,
): [left: MonthAndYear, right: MonthAndYear] {
let minView = MonthAndYear.fromDate(minDate ?? null);
Copy link
Contributor

@ggdouglas ggdouglas Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint: These variables, minView and maxView can be const.

@svc-palantir-github
Copy link

Fix lint

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@jscheiny jscheiny merged commit ffb3c18 into develop Feb 26, 2025
13 checks passed
@jscheiny jscheiny deleted the js/fix-non-config-day-picker branch February 26, 2025 15:16
ggdouglas pushed a commit that referenced this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateRangeInput3 get corrupted sometimes
3 participants