timeago
make your dates looks like facebook/twitter.
install
npm install timeago-words
or from your package.json
file:
"dependencies": { "timeago-words": "x" }
usage
var timeago = ; ; //"x days ago"timeagosettings; //will desplay all settings you can edit
make sure someDate
is a Date
object.
You can also use it in Express app templates:
var app = express; app;
<div class="timeago"><%- timeago(widget.created) %></div>
to use custom language: