A number timeago package support 2..years.ago() method
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
number.timeago.js
package.json

README.md

number-timeago Build Status

A number timeago package support 2..years.ago() method

Install

$ npm install number-timeago

It's also available on NPMCDN https://unpkg.com/number-timeago@0.1.1/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