-
Notifications
You must be signed in to change notification settings - Fork 18
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
How to specify ListFormat instance options #14
Comments
My guess was that 2. would give the semantics we generally want. 1 seems broken, and 3 seems overkill/hard to use (but maybe there's some use case for it that I'm missing?). |
Related: tc39/ecma402#422 I would prefer that we set the width of the ListFormat to match the width of the DurationFormat (long->long, short->short, narrow->narrow), and otherwise don't bubble up any other settings. I think this covers the 90% use case. When tc39/ecma402#422 is resolved, we can consider amending Intl.DurationFormat to pass down options in a similar way. |
@sffc that seems like exactly what Daniel had proposed, so I guess we can get consensus on that behavior. |
@ryzokuken , thanks for bringing this issue Therefore, let's discuss this issue next meeting and try to have a consensus about it. |
FYI: Under the hood, the "dotted" form does not actually use ListFormat, or at least that form is not available as a general purpose ListFormat pattern. |
Yes, the |
Yes, therefore, we could not pass this argument directly to |
@younies actually, the opposite. In the case of |
We have consensus on option 2. |
We have encapsulated a
ListFormat
instance insideDurationFormat
in order to format the different duration components as a single list. How should we allow users to specify options for constructing that instance? Here are our options.1. Don't specify any options for the instance.
Don't specify any options at all. Just instantiate a vanilla
ListFormat
with the same locale.2. Implicit passthrough
Implicitly passthrough the options argument to the
ListFormat
constructor.3. Explicit
Explicitly specify options for the
ListFormat
constructor, via an additional optionlistFormatOptions
./cc @littledan @younies @sffc
Reference: #11 (comment)
The text was updated successfully, but these errors were encountered: