2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Added date formatting for email post data

no issue
This commit is contained in:
Rish 2019-11-06 12:06:24 +07:00
parent 3023619ac9
commit 686e0143c7

View file

@ -2,6 +2,7 @@ const juice = require('juice');
const template = require('./template');
const settingsCache = require('../../services/settings/cache');
const urlUtils = require('../../lib/url-utils');
const moment = require('moment');
const getSite = () => {
return Object.assign({}, settingsCache.getPublic(), {
@ -10,6 +11,7 @@ const getSite = () => {
};
const serialize = (post) => {
post.published_at = post.published_at ? moment(post.published_at).format('DD MMM YYYY') : moment().format('DD MMM YYYY');
return {
subject: post.email_subject || post.title,
html: juice(template({post, site: getSite()})),