mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
- 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
16 lines
427 B
JavaScript
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;
|
|
});
|
|
}());
|