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

Improve roundToNearestMonth example #2753

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Improve roundToNearestMonth example #2753

merged 1 commit into from
Jan 15, 2024

Conversation

mjomble
Copy link
Contributor

@mjomble mjomble commented Jan 15, 2024

Fixes #2751

In addition to removing the use of hardcoded 12, I found that using Duration to find the closest option was more readable than the day of month arithmetic.

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8d9df7f) 96.73% compared to head (38e456a) 96.73%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2753   +/-   ##
=======================================
  Coverage   96.73%   96.73%           
=======================================
  Files          21       21           
  Lines       12444    12444           
  Branches     2255     2255           
=======================================
  Hits        12038    12038           
  Misses        349      349           
  Partials       57       57           

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

Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ptomato ptomato merged commit 9d64b88 into tc39:main Jan 15, 2024
9 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.

Example violates best practices for cross-calendar code
2 participants