Intl.NumberFormat.prototype.formatToParts S4
- Stage: Stage 4
- Status: Finished
- ECMAScript edition: ES2018
- Synchronized: Aug 28, 2026
- 中文译文 · Source repository
This proposal adds formatToParts methods to Intl.DateTimeFormat and Intl.NumberFormat, enabling localized formatting of string parts for custom styling or manipulation. The proposal addresses the need to access individual components of formatted output (e.g., month, currency) for advanced display. It includes a reference implementation and tests.
The README below comes from the upstream repository and may contain outdated stage or status metadata. Use the proposal details above as the current source of truth.
DateTimeFormat.prototype.formatToParts / NumberFormat.prototype.formatToParts
Proposal, specs, tests and reference implementation for DateTimeFormat.prototype.formatToParts and NumberFormat.prototype.formatToParts.
Status
Stage 4
Implementation Progress
- Polyfill
- Patch for Gecko
Backpointers
Authors
- Caridy Patiño (@caridy)
- Eric Ferraiuolo (@ericf)
- Zibi Braniecki (@zbraniecki)
Reviewers
TBD
Informative
This proposal enables locale aware formatting of strings produced by Intl formatters.