moment-precise-range
Version:
moment js with precision time
36 lines (23 loc) • 1.39 kB
Markdown
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]
A moment.js plugin to display human readable date/time ranges with precision.
```
npm install moment-precise-range --save
```
```
// Will be the moment return by the moment module, with preciseDiff appended
var moment = require('moment-precise-range');
var result = moment.preciseDiff(moment('2013-10-21 10:15:40', 'YYYY-MM-DD HH:mm:ss'),
moment('2014-02-02 01:01:01', 'YYYY-MM-DD HH:mm:ss'));
console.log(result); // 3 months 11 days 14 hours 45 minutes a few seconds
```
[]: https://npmjs.org/package/moment-precise-range
[]: http://img.shields.io/npm/v/moment-precise-range.svg
[]: https://travis-ci.org/mtscout6/moment-precise-range
[]: https://travis-ci.org/mtscout6/moment-precise-range.svg?branch=master
[]: https://coveralls.io/r/mtscout6/moment-precise-range
[]: https://img.shields.io/coveralls/mtscout6/moment-precise-range.svg?branch=master
[]: https://www.versioneye.com/user/projects/53e3f13ce0a229f1b7000057
[]: https://www.versioneye.com/user/projects/53e3f13ce0a229f1b7000057/badge.svg