tc39 / proposal-intl-relative-time

`Intl.RelativeTimeFormat` specification [draft]
http://tc39.github.io/proposal-intl-relative-time/
215 stars 24 forks source link

Should formatToParts break down the inner NumberFormat? #69

Closed littledan closed 6 years ago

littledan commented 6 years ago

When discussing the RelativeTimeFormat formatToParts method in the April 18th ICU-TC call, we agreed that the underlying ICU API would break up the inner number format into parts (in addition to exposing the entire number range). The current specification draft exposes just the range of the whole number. Would it be useful to have this level of detail in JavaScript as well? For example, this could come up in examples like, "in 1,234 days" or "1.5 seconds ago". Currently, the substrings "1234" or "1.5" are represented as a single part.

littledan commented 6 years ago

We discussed this possibility in the April 20, 2018 Intl call. The idea here was to represent both the grouping of the number/unit as well as the constituent parts by adding an additional field to represent everything. I'll follow up with a patch which does this.