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:
parent
16a726bf1b
commit
be183f3441
1 changed files with 3 additions and 1 deletions
|
@ -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'
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue