mainspring
v1.0.1
Published
Differences between dates in a useful format
Downloads
2
Readme
mainspring
Installation
npm install mainspring
Usage
const mainspring = require('mainspring');
// Compare a date against now
mainspring(new Date(2023, 8, 24));
/* -> {
inFuture: true,
days: 2401,
hours: 11,
minutes: 16,
seconds: 7
} */
// Compare two dates
mainspring(
new Date(1962, 8, 12),
new Date(1969, 5, 20)
);
/* -> {
inFuture: false,
days: 2473,
hours: 0,
minutes: 0,
seconds: 0
}
*/
Testing
npm test