Hacker News new | ask | show | jobs
by styfle 498 days ago
DurationFormat looks cool but it didn’t behave as I expected.

https://github.com/tc39/proposal-intl-duration-format/issues...

1 comments

As 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