-
Notifications
You must be signed in to change notification settings - Fork 162
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
Represent 0 differently from "missing" in durations? #564
Comments
This could work mechanically with regard to Intl.DurationFormat. I'm not sure about all of the implications. We should look at this alongside #337. |
I'm not a fan of this for two reasons:
|
I'm pretty convinced by @ptomato 's reasoning. If we go without a separate "missing" representation, I'm happy with @zbraniecki's suggestion for Intl.DurationFormation, removing the need for representing missing fields. I'm happy to drop this suggestion. |
In Intl.DurationFormat, there are controls for which fields are displayed. One possibility is that this is phrased in terms of a "fields" option, with dash-separated field names. Another option is to list lower and upper fields, as described in tc39/proposal-intl-duration-format#2 .
For a different approach: What if the data model for Temporal.Duration treated 0 differently from null/undefined? Then, Intl.DurationFormat wouldn't need the fields to be specified, and could just format all of the fields that the Duration contains.
As a straw-person, I could imagine that
.with({minute: null})
could remove the minute field (sinceundefined
would be ignored).cc @sffc @younies
The text was updated successfully, but these errors were encountered: