aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/miscs.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/miscs.js')
-rw-r--r--server/tests/utils/miscs.js23
1 files changed, 0 insertions, 23 deletions
diff --git a/server/tests/utils/miscs.js b/server/tests/utils/miscs.js
deleted file mode 100644
index c4b661496..000000000
--- a/server/tests/utils/miscs.js
+++ /dev/null
@@ -1,23 +0,0 @@
1'use strict'
2
3const miscsUtils = {
4 dateIsValid
5}
6
7// ---------------------- Export functions --------------------
8
9function dateIsValid (dateString, interval) {
10 const dateToCheck = new Date(dateString)
11 const now = new Date()
12
13 // Check if the interval is more than 2 minutes
14 if (!interval) interval = 120000
15
16 if (now - dateToCheck > interval) return false
17
18 return true
19}
20
21// ---------------------------------------------------------------------------
22
23module.exports = miscsUtils