### `Intl.DurationFormat` Stage 3 Update ⏳ ### TC39 September 2022 πŸ‡―πŸ‡΅ --- ```javascript= const duration = { years: 1, months: 2, days: 3 } const df = new Intl.DurationFormat('jp', { style: 'long' }) df.format(duration) // => 1εΉ΄2γƒΆζœˆγ¨3ζ—₯ ``` --- # Bug Fixes --- ## Pass 0 as fallback for fractionalDigits ([#113](https://github.com/tc39/proposal-intl-duration-format/pull/113)) - Sets the fallback of `fractionalDigits` to `0` instead of `undefined`. - A spec oversight, this caused non-ideal output in certain cases. --- ## Tweak "digital" defaults 1. [Change digital default from `"narrow"` to `"short"` for YMWD](https://github.com/tc39/proposal-intl-duration-format/pull/123) `1y 2m 3d 04:05:06 => 1 yr 2 mo 3 d 04:05:06` 2. [Change default display to `"always"` for HMS](https://github.com/tc39/proposal-intl-duration-format/pull/124) `04:05 => 00:04:05` --- # Improvements --- ## Use `NumberFormat` unit formatting ([#122](https://github.com/tc39/proposal-intl-duration-format/pull/122)) - DRY `DurationFormat` by using `NumberFormat` to format individual units - Removes the need for handling pluralization internally. - Depends on [tc39/ecma402#708](https://github.com/tc39/ecma402/pull/708) - Thanks Frank! --- # Consensus? --- # Thanks!
{"type":"slide"}