-
Notifications
You must be signed in to change notification settings - Fork 9
Decide on the resolvedOptions
for styles
#49
Comments
One other approach here could be to not return dateStyle at all, and only return the fields. But, that might not roundtrip completely, due to the formatRange bug. However, hopefully that bug will be fixed soon on the CLDR side. https://unicode-org.atlassian.net/browse/CLDR-13425 That would essentially be an Option 3: let dtf = new Intl.DateTimeFormat(undefined, {
dateStyle: "long"
});
// Option 3
dtd.resolvedOptions(); // {year: "numeric", month: "long", "day: "numeric"} |
@littledan, @rxavier? - what's your take on this? |
I would've expected option 1 to be the behavior. EDIT: Oh, looking back at the data model and #48, I see that Option 2 is fully possible. Not sure why I got confused. I'm still not sure whether Option 3 would reliably round-trip, though. I guess I'm OK with Option 2 not round-tripping--I don't think that's what resovedOptions is for anyway. So, I'm up for either Option 1 or 2. |
At today's ECMA402 we recorded a consensus to go with Option 1. |
The current PR has https://tc39.es/proposal-intl-datetime-style/#sec-intl.datetimeformat.prototype.resolvedoptions
So, it seems like we are currently implementing Reopen if needed. |
In issue #45 @anba pointed out that we should:
That basically means that we will not returned resolved fields in resolved options:
@sffc responded that:
to which @anba responded that:
Let's discuss this decision here.
The text was updated successfully, but these errors were encountered: