Skip to content
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

Fix DateRangePicker3 bug when initialMonth is equal to the maxDate's month #6548

Merged

Conversation

mattskrobola
Copy link
Contributor

Fixes #6546

The bug occurs when initialMonthAndYear is equal to the maxDate's month and year resulting in a buggy selection state.

We already handle this special case when using props.initialMonth or value[0] as the initial month, this PR just expands the special case check to also include the today and dateBetween cases.

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Additionally checks that today or dateBetween (if being used as initialMonth) is not the same month as maxDates month and if it is use the previous month

Reviewers should focus on:

Screenshot

Testing locally on the docs app setting the minDate as and new Date(2023, 9, 23) and maxDate as new Date(2023, 10, 15)

before:
Screenshot 2023-11-14 at 8 40 46 PM
Screenshot 2023-11-14 at 8 40 41 PM

after:
Screenshot 2023-11-14 at 8 39 54 PM
Screenshot 2023-11-14 at 8 39 02 PM

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

thanks @mattskrobola!

@adidahiya adidahiya merged commit 4994239 into palantir:develop Nov 15, 2023
12 checks passed
adidahiya pushed a commit that referenced this pull request Nov 15, 2023
Fix DateRangePicker3 bug when initialMonth is equal to the maxDate's month
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateRangeInput3: Unable to select dates of earlier month when minDate and maxDate props are 1 month apart
2 participants