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(time-duration): Time Duration Most Significant adjusted to not have approax value #2589

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rahul-p-rajesh
Copy link
Contributor

Description

Problem: On Providing an input like 44H, the output is 1 day.
Fix: Added an allowApproxUnit flag which on false keeps on checking the for time unit which is not approximate.

Checklist:

  • ✅ My changes generate no new warnings
  • ✅ I have added tests that prove my fix is effective or that my feature works
  • ✅ Any dependent changes have been merged and published in downstream modules

@rahul-p-rajesh rahul-p-rajesh requested a review from a team as a code owner December 21, 2023 09:50
Copy link

github-actions bot commented Dec 21, 2023

Test Results

    4 files  ±0    316 suites  ±0   32m 36s ⏱️ +3s
1 136 tests ±0  1 136 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 146 runs  ±0  1 146 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f15d131. ± Comparison against base commit 389047b.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (389047b) 81.69% compared to head (f15d131) 81.70%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2589   +/-   ##
=======================================
  Coverage   81.69%   81.70%           
=======================================
  Files         928      928           
  Lines       20790    20793    +3     
  Branches     3136     3139    +3     
=======================================
+ Hits        16984    16988    +4     
+ Misses       3665     3664    -1     
  Partials      141      141           

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

@rahul-p-rajesh rahul-p-rajesh marked this pull request as draft December 21, 2023 10:08
@rahul-p-rajesh rahul-p-rajesh marked this pull request as ready for review December 21, 2023 10:20
@aaron-steinfeld
Copy link
Contributor

aaron-steinfeld commented Dec 21, 2023

Problem: On Providing an input like 44H, the output is 1 day.
Fix: Added an allowApproxUnit flag which on false keeps on checking the for time unit which is not approximate

That's the whole point of the function though. In that example, 'day' is the most significant unit. The behavior you're describing is something else, so we shouldn't overload the existing function with a boolean flag (code smell!). We'd want a whole new function. That said, given we already can represent this as a 1d20h and as 1d, do we really need a third representation? The UX consistency here is concerning.

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.

None yet

2 participants