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

Integrate with Intl.DurationFormat #452

Closed
ryzokuken opened this issue Mar 19, 2020 · 9 comments · Fixed by #3088
Closed

Integrate with Intl.DurationFormat #452

ryzokuken opened this issue Mar 19, 2020 · 9 comments · Fixed by #3088
Assignees
Milestone

Comments

@ryzokuken
Copy link
Member

#129 (comment) never really took Duration into account from what it seems, we should discuss this in a meeting.

@ryzokuken ryzokuken self-assigned this Mar 19, 2020
@sffc
Copy link
Collaborator

sffc commented Mar 19, 2020

We have an open proposal to add Intl.DurationFormat:

https://github.com/younies/proposal-intl-duration-format

@ptomato
Copy link
Collaborator

ptomato commented Mar 19, 2020

Discussed in the March 19 meeting: We'll update the Intl.DurationFormat in our polyfill to match the one in the proposal as needed.

@ryzokuken Should this issue remain open to implement that, or is it more something that will be done on an ongoing basis as other issues are fixed?

@littledan littledan changed the title Intl.DateTimeFormat doesn't quite work for Duration Integrate with Intl.DurationFormat May 14, 2020
@littledan
Copy link
Member

I'm leaving out the Stage 3 milestone; I think the integration at both the spec and polyfill levels are more milestones for Intl.DurationFormat, and don't block Stage 3 or polyfill distribution for Temporal.

@anba
Copy link
Contributor

anba commented Jan 21, 2025

Should implementers go ahead and provide locale-sensitive Duration.prototype.toLocaleString even without an official spec (PR)? We've already received two reports about why Duration.prototype.toLocaleString just returns the same result as Duration.prototype.toString (https://bugzilla.mozilla.org/show_bug.cgi?id=1839694#c4, https://bugzilla.mozilla.org/show_bug.cgi?id=1942850).

Maybe there's confusion because the Temporal polyfill already provides locale-sensitive Duration.prototype.toLocaleString (when Intl.DurationFormat is available)?

@dminor
Copy link

dminor commented Feb 7, 2025

Alternatively, maybe the polyfill should remove this behaviour until it has been specified, to avoid causing confusion.

@ptomato This is a potential blocker for us to be able to ship Temporal. Would it be possible for the champions to have a look at this and give us some guidance on the best way to proceed?

@sffc
Copy link
Collaborator

sffc commented Feb 7, 2025

Intl.DurationFormat is Stage 4 (although the PR hasn't been merged yet).

So it should be safe to add toLocaleString to the Stage 3 Temporal proposal.

CC @ryzokuken

@ptomato
Copy link
Collaborator

ptomato commented Feb 8, 2025

I'll take a look at this next week.

@ptomato ptomato self-assigned this Feb 13, 2025
ptomato added a commit that referenced this issue Feb 13, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This operation had a placeholder note until the Intl.DurationFormat
proposal would reach stage 4. Now that the proposal is stage 4, we can
replace the placeholder note with the real implementation.

Closes: #452
@ptomato
Copy link
Collaborator

ptomato commented Feb 13, 2025

@dminor @anba This is done in #3088, which is based on the current stage 4 state of Intl.DurationFormat in tc39/ecma402#943. Hopefully this is what you need!

I'd be interested in your opinion on whether it needs to wait for tc39/ecma402#943 before merging or you'd be happy with merging it now.

ptomato added a commit that referenced this issue Feb 13, 2025
This operation had a placeholder note until the Intl.DurationFormat
proposal would reach stage 4. Now that the proposal is stage 4, we can
replace the placeholder note with the real implementation.

Closes: #452
@anba
Copy link
Contributor

anba commented Feb 14, 2025

I'd be interested in your opinion on whether it needs to wait for tc39/ecma402#943 before merging or you'd be happy with merging it now.

I don't think this needs to wait for tc39/ecma402#943.

ptomato added a commit that referenced this issue Feb 14, 2025
This operation had a placeholder note until the Intl.DurationFormat
proposal would reach stage 4. Now that the proposal is stage 4, we can
replace the placeholder note with the real implementation.

Closes: #452
ptomato added a commit that referenced this issue Feb 14, 2025
This operation had a placeholder note until the Intl.DurationFormat
proposal would reach stage 4. Now that the proposal is stage 4, we can
replace the placeholder note with the real implementation.

Closes: #452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants