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

(feature) swapRange optional prop #4654

Merged
merged 3 commits into from
Apr 3, 2024

Conversation

mirus-ua
Copy link
Contributor

@mirus-ua mirus-ua commented Apr 2, 2024


name: swapRange prop
about: Gives more flexibility on input flow

Problem
When a user works with extensive date ranges, it could be tedious to scroll back and forth if the user makes a mistake.

Changes
The change adds an optional property swapRange to DatePicker component that allows the user to swap dates if we want the end user to pick dates in any order. This is a real request from the end users, and it will be handy if you work with big date ranges.

Screenshots

Знімок екрана 2024-04-02 о 10 51 56

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.

…component that allows the functionality of swapping dates if we want to allow the end user to pick dates in any order. This is a real request from the end users, and it will be handy if you work with big date ranges.
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 for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!

What to expect from this code review:
  • Comments posted to any areas of potential concern or improvement.
  • Detailed feedback or actions needed to resolve issues that are found.
  • Turnaround times vary, but we aim to be swift.

@mirus-ua 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

+ 73
- 1

51% JavaScript
49% JavaScript (tests)

Type of change

Feature - These changes are adding a new feature or improvement to existing code.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.00%. Comparing base (a78e0a5) to head (8e5dd6b).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4654   +/-   ##
=======================================
  Coverage   96.99%   97.00%           
=======================================
  Files          28       28           
  Lines        2632     2635    +3     
  Branches     1114     1116    +2     
=======================================
+ Hits         2553     2556    +3     
  Misses         79       79           

☔ 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.

Looks good & nice feature. Just added a small comment about a potential future bug if someone edits the else if statement ordering.

Image of Curtis Larson Curtis Larson


Reviewed with ❤️ by PullRequest

src/index.jsx Outdated Show resolved Hide resolved
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 reviewed the updates made to #4654 up until the latest commit (dd7f40c). No further issues were found.

Reviewed by:

Image of Curtis Larson Curtis Larson

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.

Reading the code carefully, I didn't see any defects. I gave a comment related to fixed dates in tests.

Hopefully this review helped you.

Image of John G John G


Reviewed with ❤️ by PullRequest

test/datepicker_test.test.js Outdated Show resolved Hide resolved
@mirus-ua mirus-ua requested a review from martijnrusschen April 3, 2024 07:15
@martijnrusschen martijnrusschen merged commit 57d7cfa into Hacker0x01:main Apr 3, 2024
6 checks passed
@mirus-ua mirus-ua deleted the feature/swapRange branch April 3, 2024 07:22
@alex-i-web
Copy link

Great feature, I can't wait to get this feature in npmjs :)

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.

3 participants