Skip to content

Conversation

balajis-qb
Copy link
Contributor

@balajis-qb balajis-qb commented Jul 21, 2025

Description

This PR is not about any new features or bug fixes. It is about refactoring the code to make it more readable and maintainable.

Changes

  • I have moved the input value get logic to a separate function
  • Refactored the nested conditional statements to if else conditions for readability.

Screenshots

Old Code
image

New Code
image

I didn't change anything in the get logic, instead just refactored the existing logic to a readable format.

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.

- Move the input value get logic to a seperate function
- Refactor the nested conditional statements to if else conditions for readability
@balajis-qb balajis-qb changed the title ♻️ Refactor the input value get logic to a seperate function ♻️ Refactor the input value get logic Jul 21, 2025
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.19%. Comparing base (fac5608) to head (b0ac0ae).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5743      +/-   ##
==========================================
+ Coverage   97.13%   97.19%   +0.06%     
==========================================
  Files          30       30              
  Lines        3380     3382       +2     
  Branches     1411     1426      +15     
==========================================
+ Hits         3283     3287       +4     
+ Misses         97       93       -4     
- Partials        0        2       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@balajis-qb balajis-qb force-pushed the refactor/date-input-value branch from 9e3be9e to 66df4dc Compare July 21, 2025 12:17
@balajis-qb
Copy link
Contributor Author

As I was getting an issue in the test coverage to reach the default value set for dateFormat, I added Nullish Coalescing Operator to to handling both undefined and null case of dateFormat (like we use in other places of index.tsx) and added a new commit.

@martijnrusschen
Copy link
Member

Can you take a look at the merge conflict?

@balajis-qb
Copy link
Contributor Author

Resolved the conflict @martijnrusschen

@martijnrusschen martijnrusschen merged commit a186869 into Hacker0x01:main Aug 9, 2025
7 checks passed
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.

2 participants