node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

duration-calculator

duration-calculator

viktort

Build Status

shackpank (fork)

Build Status

A module for calculating the duration between two given dates, irrespective of the order.

Usage

If you have npm installed

$ npm install duration-calculator

Inside a js file:

var durationCalculator = require('duration-calculator');
 
var duration = durationCalculator.calculate(date1, date2);
 
console.log('Duration = ' + duration);