mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed members-click-event created_at time
no issue The faker date method seems to spontaneously fail sometimes, as it had decided that the "later" time was before the opened time.
This commit is contained in:
parent
923c522778
commit
744b92333c
1 changed files with 2 additions and 1 deletions
|
@ -32,6 +32,7 @@ class MembersClickEventsImporter extends TableImporter {
|
|||
const openedAt = new Date(this.model.opened_at);
|
||||
const laterOn = new Date(this.model.opened_at);
|
||||
laterOn.setMinutes(laterOn.getMinutes() + 15);
|
||||
const clickTime = new Date(openedAt.valueOf() + (Math.random() * (laterOn.valueOf() - openedAt.valueOf())));
|
||||
|
||||
return {
|
||||
id: faker.database.mongodbObjectId(),
|
||||
|
@ -40,7 +41,7 @@ class MembersClickEventsImporter extends TableImporter {
|
|||
min: 0,
|
||||
max: this.redirectList.length - 1
|
||||
})].id,
|
||||
created_at: dateToDatabaseString(faker.date.between(openedAt, laterOn))
|
||||
created_at: dateToDatabaseString(clickTime)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue