diff options
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/miscs.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/tests/utils/miscs.js b/server/tests/utils/miscs.js index 4ceff65df..c4b661496 100644 --- a/server/tests/utils/miscs.js +++ b/server/tests/utils/miscs.js | |||
@@ -6,12 +6,14 @@ const miscsUtils = { | |||
6 | 6 | ||
7 | // ---------------------- Export functions -------------------- | 7 | // ---------------------- Export functions -------------------- |
8 | 8 | ||
9 | function dateIsValid (dateString) { | 9 | function dateIsValid (dateString, interval) { |
10 | const dateToCheck = new Date(dateString) | 10 | const dateToCheck = new Date(dateString) |
11 | const now = new Date() | 11 | const now = new Date() |
12 | 12 | ||
13 | // Check if the interval is more than 2 minutes | 13 | // Check if the interval is more than 2 minutes |
14 | if (now - dateToCheck > 120000) return false | 14 | if (!interval) interval = 120000 |
15 | |||
16 | if (now - dateToCheck > interval) return false | ||
15 | 17 | ||
16 | return true | 18 | return true |
17 | } | 19 | } |