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
;
AMD
;
then
// seconds20seconds // => 20,000 milliseconds// minutes10minutes // => 600,000 milliseconds// weeks, days, months, years so on // time ago2months // will return 2 months ago Date object// => Mon Mar 28 2016 11:46:07 GMT+0800 (CST)
License
MIT © Falm