Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sylvaindethier/47fa9d008273a0954052 to your computer and use it in GitHub Desktop.
Save sylvaindethier/47fa9d008273a0954052 to your computer and use it in GitHub Desktop.
Handlebars helper that handle MomentJS `fromNow` method
/**
* Moment - fromNow
*/
Handlebars.registerHelper('moment_unix_fromNow', function (timestamp) {
return moment.unix(timestamp).fromNow();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment