mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
d1957958e3
Aligns all requirements vertically for easier reading + adds single quote standard consistently throughout Ghost, except in long strings.
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;
|
|
});
|
|
}());
|