jsmreese / moment-duration-format

Format function plugin for the Moment Duration object.
MIT License
969 stars 120 forks source link

forceLength is ignored when formatting milliseconds #80

Closed mathiasjakobsen closed 6 years ago

mathiasjakobsen commented 6 years ago
const duration = moment.duration(5.6789101112, 'seconds').format('mm:ss:SS', {
  trim: false,
  forceLength: true
})

will output 00:05:678 instead of expected 00:05:67 ⌛️

jsmreese commented 6 years ago

This behaviour is updated in version 2.0.0, which is almost done, and not yet published. On version 1.3 you get the issue you see. On version 2, you'll get the output you expect.

I'll hopefully have it published in the next few days, but in the interim, you can use the plugin version currently on the master branch.

mathiasjakobsen commented 6 years ago

@jsmreese Thanks 🍻