diff --git a/core/server/helpers/date.js b/core/server/helpers/date.js index eb18d95f6e..760716d79d 100644 --- a/core/server/helpers/date.js +++ b/core/server/helpers/date.js @@ -13,14 +13,13 @@ module.exports = function (date, options) { if (!options && date.hasOwnProperty('hash')) { options = date; date = undefined; - } + timezone = options.data.blog.timezone; - timezone = options.data.blog.timezone; - - // set to published_at by default, if it's available - // otherwise, this will print the current date - if (this.published_at) { - date = moment(this.published_at).tz(timezone).format(); + // set to published_at by default, if it's available + // otherwise, this will print the current date + if (this.published_at) { + date = moment(this.published_at).tz(timezone).format(); + } } // ensure that context is undefined, not null, as that can cause errors