diff --git a/plugins/c9.abtesting/abtesting.js b/plugins/c9.abtesting/abtesting.js index 04cfe261..44fc2b00 100644 --- a/plugins/c9.abtesting/abtesting.js +++ b/plugins/c9.abtesting/abtesting.js @@ -32,7 +32,7 @@ function main(options, imports, register) { function isUserCreatedAfter(experimentDate, user) { if (!user || !user.date_add) throw new Error("Expected: user"); - var diffDays = (experimentDate - experimentDate.now()) / MS_PER_DAY; + var diffDays = (experimentDate - Date.now()) / MS_PER_DAY; if (diffDays > 20) { // Sanity check: new Date() takes zero-based month argument, one-based day argument throw new Error("Passed a date far in the future to isUserCreatedAfter()"); diff --git a/plugins/c9.ide.abtesting/abtesting.js b/plugins/c9.ide.abtesting/abtesting.js index c1747bf8..1a7160db 100644 --- a/plugins/c9.ide.abtesting/abtesting.js +++ b/plugins/c9.ide.abtesting/abtesting.js @@ -47,7 +47,7 @@ define(function(require, exports, module) { } function isUserCreatedAfter(experimentDate) { - var diffDays = (experimentDate - experimentDate.now()) / MS_PER_DAY; + var diffDays = (experimentDate - Date.now()) / MS_PER_DAY; if (diffDays > 20) { // Sanity check: new Date() takes zero-based month argument, one-based day argument throw new Error("Passed a date far in the future to isUserCreatedAfter()");