mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 05:42:32 +03:00
30b4eb07f7
- This is a first pass at getting a more logical structure. The focus is on moving from admin/frontend to client/server. - The location of the databases is highly important, this isn't expected to change again In the future - client/assets should probably become public/ - more stuff should be shared (helpers etc) - cleanup some confusion around tpl and views
17 lines
427 B
JavaScript
17 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;
|
|
});
|
|
}());
|