1.1.3 • Published 8 years ago

duration-time-format v1.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Duration Time

Usage

const DurationTime = require('duration-time')

// Format a duration time into h:m:s
DurationTime().format(11111) === '03:05:11'

// Specify colon number
DurationTime({
    colonNumber: 1
}).format(11111) === '185:11'

// Without leading zeros
DurationTime({
    hasLeadingZero: false
}).format(11111) === '3:5:11'

// Always display decimals
DurationTime({
    alwaysDisplayDecimals: true
}).format(11111) === '03:05:11.00'

// Specify decimals width
DurationTime({
    keepDecimals: 2
}).format(11111.1) === '185:11.10'

// Pasre formatted string back
DurationTime.parse('03:05:11.10') === 11111.1
DurationTime.parse('185:11') === 11111
1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago