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: reset remainder after its been used and update date_range_lesser… #223

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

cezarcarvalhaes
Copy link
Contributor

… test

This fixes #222. The issue was that remainder was being carried over inside the for loop. Original test didn't catch it because the "below-min-val" was second last (month), so it would only update the year (as it should).

If another date part earlier in the array (such as day) was below the minimum value, then remainder would mutate all subsequent parts in the date.

@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #223 (acd3080) into master (b70467e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #223   +/-   ##
=======================================
  Coverage   99.34%   99.34%           
=======================================
  Files         247      247           
  Lines        3357     3358    +1     
  Branches      757      757           
=======================================
+ Hits         3335     3336    +1     
  Misses         21       21           
  Partials        1        1           
Impacted Files Coverage Δ
src/operators/expression/date/dateFromParts.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b70467e...acd3080. Read the comment docs.

@kofrasa kofrasa merged commit 7aae376 into kofrasa:master Feb 2, 2022
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.

Subtracting a day from a first day of month date results in subtracting one year and one day.
2 participants