From b99d3bc70aa5b2656955a952dbe46058216d6855 Mon Sep 17 00:00:00 2001 From: Aileen Nowak Date: Tue, 9 Jan 2018 18:35:08 +0700 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=90=9B=20Fixed=20date=20helper?= =?UTF-8?q?=20timezone=20bug=20(#9382)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c3b0219d7020dd4a1db4c7f802c6651b900c0b65. --- core/server/helpers/date.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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