0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

🐛 fix DST in listeners spec (#7652)

no issue
- we need to calculate the timezone offset dynamically, because of DST
This commit is contained in:
Katharina Irrgang 2016-10-31 12:46:29 +01:00 committed by Hannah Wolfe
parent 16a726bf1b
commit be183f3441

View file

@ -13,11 +13,13 @@ var should = require('should'),
describe('Models: listeners', function () {
var eventsToRemember = {},
now = moment(),
scope = {
posts: [],
publishedAtFutureMoment1: moment().add(2, 'days').startOf('hour'),
publishedAtFutureMoment3: moment().add(10, 'hours').startOf('hour'),
timezoneOffset: -480,
// calculate the offset dynamically, because of DST
timezoneOffset: moment.tz.zone('Europe/London').offset(now) - moment.tz.zone('America/Los_Angeles').offset(now),
newTimezone: 'America/Los_Angeles',
oldTimezone: 'Europe/London'
};