mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
🐛 Fixed date helper timezone bug (#9382)
closes #9381 Fixes a bug where the date helper would ignore any timezone settings, when called with a specific date option, e. g. `published_at`.
This commit is contained in:
parent
a1393762f6
commit
c3b0219d70
1 changed files with 7 additions and 6 deletions
|
@ -13,13 +13,14 @@ module.exports = function (date, options) {
|
|||
if (!options && date.hasOwnProperty('hash')) {
|
||||
options = date;
|
||||
date = undefined;
|
||||
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();
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
// ensure that context is undefined, not null, as that can cause errors
|
||||
|
|
Loading…
Add table
Reference in a new issue