9 ms·
DurationFormat looks cool but it didn’t behave as I expected. https://github.com/tc39/proposal-intl-duration-format/issues/210 https://github.com/tc39/proposal
by styfle 2y ago
DurationFormat looks cool but it didn’t behave as I expected.
https://github.com/tc39/proposal-intl-duration-format/issues/210 https://github.com/tc39/proposal-intl-duration-format/issues...
- burntsushi 2y agoAs the comment mentions there, the idea is that you can do those sorts of transformations on the duration and then emit them: >> d = Temporal.Duration.from({milliseconds: 60000}) >> d.seconds 0 >> d.milliseconds 60000 >> d = d.round({largestUnit: 'second'}) >> d.seconds 60 >> d.milliseconds 0