3.1.0 • Published 2 years ago

@boertel/duration v3.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

duration

TypeScript library to format durations (days, hours, minutes, seconds, and milliseconds)

Install

npm install @boertel/duration

Usage

import { duration } from "@boertel/duration";

console.log(duration(2892992000).format("d DD, h HH [and] m MM"));
// 33 days, 11 hours and 36 minutes

// more readable way to create a duration:
const d = duration().days(2).hours(5).seconds(4);
// this will ignore 0 values and join with commas and "and"
console.log(d.format(["dD", "hH", "mM", "sS"]));
// 2d, 5h and 4s
3.1.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago