Ghost/core/client/app/helpers/gh-format-timeago.js

17 lines
506 B
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Ember from 'ember';
const {Helper} = Ember;
export default Helper.helper(function (params) {
if (!params || !params.length) {
return;
}
let [timeago] = params;
return moment(timeago).fromNow();
// stefanpenner says cool for small number of timeagos.
// For large numbers moment sucks => single Ember.Object based clock better
// https://github.com/manuelmitasch/ghost-admin-ember-demo/commit/fba3ab0a59238290c85d4fa0d7c6ed1be2a8a82e#commitcomment-5396524
});