mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
d1af144f52
closes #381 - renamed entries for dateFormat in helpers to date - renamed entries for paginate in helpers and unit tests to pagination
17 lines
421 B
JavaScript
17 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;
|
|
});
|
|
}());
|