mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 11:30:55 +03:00
2a91a1071e
No issue. - Ember@1.10.0 - Update grunt-ember-templates to version that supports HTMLBars. - Update Gruntfile.js to compile templates with HTMLBars. - Convert Handlebars code to its HTMLBars equivalent.
15 lines
512 B
JavaScript
15 lines
512 B
JavaScript
var formatTimeago = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) {
|
|
if (!arr || !arr.length) {
|
|
return;
|
|
}
|
|
|
|
var timeago = arr[0];
|
|
|
|
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
|
|
});
|
|
|
|
export default formatTimeago;
|