Utility to separate into parts and to format time duration in milliseconds
JavaScript CSS Makefile
Switch branches/tags
Nothing to show
Latest commit 59d34b8 Jan 13, 2015 @gamtiq Add data about SPM package
Permalink
Failed to load latest commit information.
dist
doc
test
.gitignore
.spmignore
.travis.yml
Gruntfile.js
History.md
LICENSE
Makefile
README.md
bower.json
component.json
duratiform.js
package.json

README.md

duratiform

Utility to separate into parts and to format time duration in milliseconds.

NPM version Build Status

Installation

Node

npm install duratiform

Component

component install gamtiq/duratiform

Jam

jam install duratiform

Bower

bower install duratiform

SPM

spm install duratiform

AMD, <script>

Use dist/duratiform.js or dist/duratiform.min.js (minified version).

Usage

Node, Component, SPM

var duratiform = require("duratiform");

Jam

require(["duratiform"], function(duratiform) {
    ...
});

AMD

define(["path/to/dist/duratiform.js"], function(duratiform) {
    ...
});

Bower, <script>

<!-- Use bower_components/duratiform/dist/duratiform.js if the library was installed by Bower -->
<script type="text/javascript" src="path/to/dist/duratiform.js"></script>
<script type="text/javascript">
    // duratiform is available via duratiform field of window object
    ...
</script>

Example

var nDuration = 123456789000;
console.log("Duration parts: ", duratiform.divide(nDuration, 4));
console.log(nDuration, " - ", duratiform.format(nDuration, "d [days] h [hours] m [minutes] s [seconds]"));

See test/duratiform.js for additional examples.

API

See doc folder.

License

MIT