mynpm-timeago
v1.0.0
Published
numric time ago like rails
Downloads
4
Readme
number-timeago
A number timeago package support 2..years.ago() method
Install
$ npm install number-timeago
It's also available on NPMCDN https://unpkg.com/[email protected]/number.timeago.js
Usage
Node.js CommonJS
require("number-timeago")();
AMD
require(['number-timeago'], function (NumberTimeAgo) {
NumberTimeAgo();
});
then
// seconds
20..seconds // => 20,000 milliseconds
// minutes
10..minutes // => 600,000 milliseconds
// weeks, days, months, years so on
// time ago
2..months.ago() // will return 2 months ago Date object
// => Mon Mar 28 2016 11:46:07 GMT+0800 (CST)
License
MIT © Falm