Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RegulateDuration in spec is lossy #646

Closed
rbuckton opened this issue Jun 4, 2020 · 2 comments · Fixed by #659
Closed

RegulateDuration in spec is lossy #646

rbuckton opened this issue Jun 4, 2020 · 2 comments · Fixed by #659
Labels
spec-text Specification text involved
Milestone

Comments

@rbuckton
Copy link

rbuckton commented Jun 4, 2020

https://tc39.es/proposal-temporal/#sec-temporal-regulateduration, Step 4.b:

b. Let bd be ! BalanceDuration(0, hours, minutes, seconds, milliseconds, microseconds, nanoseconds, > "hours").
c. Set hours to bd.[[Hours]].
d. Set minutes to bd.[[Minutes]].
e. Set seconds to bd.[[Seconds]].
f. Set milliseconds to bd.[[Milliseconds]].
g. Set microseconds to bd.[[Microseconds]].
h. Set nanoseconds to bd.[[Nanoseconds]].

Hours in excess of 24 are not applied to the days of the duration.

@ptomato ptomato added the spec-text Specification text involved label Jun 4, 2020
@ptomato ptomato added this to the Stage 3 milestone Jun 4, 2020
@justingrant
Copy link
Collaborator

Is this related to the "three kinds of Duration" discussion in #639 and #559?

Depending on the outcome of those discussions, would we want to stop balancing from hours to days and vice versa??

@ptomato
Copy link
Collaborator

ptomato commented Jun 5, 2020

I think this is just an error in the spec as-is, and should be fixed regardless of the outcome of the discussion.

ryzokuken added a commit to ryzokuken/proposal-temporal that referenced this issue Jun 10, 2020
When RegulateDuration is called with { disambiguation: 'balance' },
balance up hours in excess of 24 to days.

Fixes: tc39#646
ptomato pushed a commit that referenced this issue Jun 10, 2020
When RegulateDuration is called with { disambiguation: 'balance' },
balance up hours in excess of 24 to days.

Fixes: #646
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
spec-text Specification text involved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants