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: #4594 fix setSelected #4602

Merged
merged 1 commit into from
Mar 16, 2024
Merged

Conversation

yuki0410-dev
Copy link
Contributor

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

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

Copy link

@pullrequest pullrequest bot left a 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.

Copy link

@pullrequest pullrequest bot left a 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.

Copy link

codecov bot commented Mar 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.90%. Comparing base (72ded5b) to head (77f3516).

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.
📢 Have feedback on the report? Share it here.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

Please add a test - otherwise this looks reasonable!

Image of Will B Will B


Reviewed with ❤️ by PullRequest

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)) {
Copy link

Choose a reason for hiding this comment

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

It would be helpful to add a test to duplicate the error so that we don't see a regression in a future version. Would you be willing to add that?

🔸 Improve Test Coverage (Important)

Image of Will B Will B

@yuki0410-dev
Copy link
Contributor Author

Tests were added.

@martijnrusschen martijnrusschen merged commit a044048 into Hacker0x01:main Mar 16, 2024
6 checks passed
@yuki0410-dev yuki0410-dev deleted the fix/4594 branch March 16, 2024 13:43
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.

Uncaught Error: Invalid date received
2 participants