aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-30 11:45:00 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-30 11:45:00 +0100
commit79066fdf33f79d2d41394f10881e2c226ca26b49 (patch)
tree4e7356b1e0d56dd64dfe2039ca97326560495809 /server/tests/utils
parent3d118fb501f576a298f6bb059167e4c7f4dd8dcc (diff)
downloadPeerTube-79066fdf33f79d2d41394f10881e2c226ca26b49.tar.gz
PeerTube-79066fdf33f79d2d41394f10881e2c226ca26b49.tar.zst
PeerTube-79066fdf33f79d2d41394f10881e2c226ca26b49.zip
Server: add updatedAt attribute to videos
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/miscs.js6
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
9function dateIsValid (dateString) { 9function 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}