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

Editorial: Tweaks to UnbalanceDateDurationRelative #2678

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Editorial: Tweaks to UnbalanceDateDurationRelative #2678

merged 2 commits into from
Sep 25, 2023

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Sep 21, 2023

These are pulled out of #2612 to make the normative diff smaller.

…llible

If we return before we do any calculations, then the _months_, _weeks_,
and _days_ quantities come directly from a previous Duration Record, so
they cannot cause CreateDateDurationRecord to fail.

Reverse the sense of the check in the _largestUnit_ = *"day"* clause so it
also becomes an early return and infallible.
Adding returns at the end of each largestUnit case makes it clearer that
some duration units are definitely zero when we return.
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (e7055b4) 96.22% compared to head (e2e0e18) 96.22%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2678   +/-   ##
=======================================
  Coverage   96.22%   96.22%           
=======================================
  Files          20       20           
  Lines       11986    11986           
  Branches     2227     2227           
=======================================
  Hits        11534    11534           
  Misses        389      389           
  Partials       63       63           

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

@Ms2ger Ms2ger merged commit 69a2c5b into main Sep 25, 2023
@Ms2ger Ms2ger deleted the editorial branch September 25, 2023 10:32
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