delta-time
Time duration and difference library to extend Date functionality.
Usage
; // With millisecondsconst dt = someDurationInMS; // Or with difference between numbersconst dt = Delta; // Or with difference between Date objects:const dt = Delta; console;
Supported extractions:
durationInMS: number;
milliseconds/ms: number; // milliseconds
seconds/sec: number; // seconds
minutes/min: number; // minutes
hours/h: number; // hours
days/d: number; // day
weeks/w: number; // week
Contribution
Contribution is welcome, however to save time and wasted work please create an issue with your suggested improvments.
Running Tests
Test are written with mocha
and chai
. Tests can be run locally using:
npm test
Generating Docs
Documentation is performed using tsdocs
. Once generated you can view them inside the generated local directory docs/
.
npm run docs
Formatting
Formatting is performed using prettier. The formatting is configured to run on commit, but if you wish to run it anyway:
npm run fmt