-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: #4594 fix setSelected #4602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ This pull request was sent to the PullRequest network.
@yuki0410-dev you can click here to see the review status or cancel the code review job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequest Breakdown
Reviewable lines of change
+ 27
- 1
86% JavaScript (tests)
14% JavaScript
Type of change
Fix - These changes are likely to be fixing a bug or issue.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4602 +/- ##
=======================================
Coverage 96.90% 96.90%
=======================================
Files 28 28
Lines 2581 2583 +2
Branches 1077 1078 +1
=======================================
+ Hits 2501 2503 +2
Misses 80 80 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/index.jsx
Outdated
@@ -697,7 +697,7 @@ export default class DatePicker extends React.Component { | |||
if (noRanges) { | |||
onChange([changedDate, null], event); | |||
} else if (hasStartRange) { | |||
if (isDateBefore(changedDate, startDate)) { | |||
if (changedDate === null || isDateBefore(changedDate, startDate)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests were added. |
Description
Linked issue: close #4594
Problem
See issue #4594
Changes
Added null check because passing null as the first argument of isBefore causes an error.
Screenshots
To reviewers
Contribution checklist