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

Reimplement duration rounding #301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leduyquang753
Copy link

(This is part of a set of multiple pull requests looking to overhaul the calculation functions.)

This pull request reimplements duration rounding. roundToSingleUnit now rebalances the incoming duration by applying the Duration to the reference date and recomputes a new balanced duration with elapsedTime. A new function roundBalancedToSingleUnit is added which does the actual rounding using a generalized routine across all units.

This implementation does not account for the perceptual difference in the units of the two dates but rather only considers the duration itself. A new relative time implementation that considers the perceptual difference is in pull request #300.

Certain tests were temporarily modified to accomodate this pull request's isolated changes and will need to be changed again as other parts of the pull request set are completely integrated.

@leduyquang753 leduyquang753 requested a review from a team as a code owner December 31, 2024 10:30
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.

1 participant