0.1.2 • Published 8 years ago

number-timeago v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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://npmcdn.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