Package Exports
- elapsed
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (elapsed) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Elapsed
npm install elapsedA module for getting the elapsed time between two dates in various representation.
var Elapsed = require('elapsed');
var elapsedTime = new Elapsed(new Date(2013, 05, 2), new Date(2013, 05, 25));
console.log(elapsedTime.minutes.num); // 33120
console.log(elapsedTime.hours.text); // "552 hours"
console.log(elapsedTime.optimal); // "3 weeks"create
var elapsedTime = new Elapsed(from, to);The from (required) and to (optional, default: now) must be Date objects.
properties
- milliSeconds: (Object),
numproperty is the time in Number,textis the time in String. - seconds: (Object),
numproperty is the time in Number,textis the time in String. - minutes: (Object),
numproperty is the time in Number,textis the time in String. - hours: (Object),
numproperty is the time in Number,textis the time in String. - days: (Object),
numproperty is the time in Number,textis the time in String. - weeks: (Object),
numproperty is the time in Number,textis the time in String. - months: (Object),
numproperty is the time in Number,textis the time in String. - years: (Object),
numproperty is the time in Number,textis the time in String. - optimal: (String), the best from the ones above.
- from: (Date)
- to: (Date)
methods
- set(): calculating the properties.
- refresh(to): refresh the
todate.tois optional it defaults to now.