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

DurationFormat resolvedOptions() output should always include fractionalDigits #964

Open
gibson042 opened this issue Mar 1, 2025 · 0 comments
Labels
behavior c: datetime Component: dates, times, timezones needs consensus normative s: discuss Status: TG2 must discuss to move forward

Comments

@gibson042
Copy link
Contributor

Objects returned from resolvedOptions() sometimes omit fields, but generally only when they have no meaningful interpretation (e.g., NumberFormat {minimum,maximum}{Fraction,Significant}Digits or Collator numeric/caseFirst when those are not relevant extension keys).

But DurationFormat omits fractionalDigits whenever input options do not define a numeric value for it, which seems odd. Rather than having Object.getOwnPropertyDescriptor(new Intl.DurationFormat().resolvedOptions(), "fractionalDigits") return undefined (implicitly propagating a value that might be defined on Object.prototype), I'd like to see it return { value: undefined, writable: true, enumerable: true, configurable: true }, such that the shape of returned objects is always consistent.

@gibson042 gibson042 added behavior c: datetime Component: dates, times, timezones needs consensus normative s: discuss Status: TG2 must discuss to move forward labels Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior c: datetime Component: dates, times, timezones needs consensus normative s: discuss Status: TG2 must discuss to move forward
Projects
None yet
Development

No branches or pull requests

1 participant