1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/helpers/index.js
cobbspur 2294470497 rename helpers paginate -> pagination, dateFormat -> date
closes #381

- renamed entries for dateFormat in helpers to date
- renamed entries for paginate in helpers  and unit tests to pagination
2013-08-22 20:42:54 +01:00

16 lines
421 B
JavaScript

/*globals Handlebars, moment
*/
(function () {
"use strict";
Handlebars.registerHelper('date', function (context, block) {
var f = block.hash.format || "MMM Do, YYYY",
timeago = block.hash.timeago,
date;
if (timeago) {
date = moment(context).fromNow();
} else {
date = moment(context).format(f);
}
return date;
});
}());