0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/admin/assets/js/helpers/index.js
cobbspur 8bbacd9ec9 closes #195 posts date on content page
- adds dateFormat handlebars helper for client side with extra option to format in time since style
- adds this extra dateFormat option to existing server side helper.
- adds scss for draft and scheduled status
- adds true/false values to post for draft  and published to validate in handlebars
- changes admin>content post collection query to order posts by updated_at values in router.js
- adds minified moment.js and links to moment.js and helper.js for clientside
2013-07-04 19:42:49 +01:00

16 lines
427 B
JavaScript

/*globals Handlebars, moment
*/
(function () {
"use strict";
Handlebars.registerHelper('dateFormat', 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;
});
}());