aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-import-videos.ts
diff options
context:
space:
mode:
authorFlorent F <florent.fayolle69@gmail.com>2019-11-04 08:44:38 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-11-04 17:38:03 +0100
commit71056d000864f0bc059626627772ddb61055f211 (patch)
tree95785907ac2ab01af145df8d129603e559c9091d /server/tools/peertube-import-videos.ts
parent532ea1fe22c94bb379ed219993237ed2e556f406 (diff)
downloadPeerTube-71056d000864f0bc059626627772ddb61055f211.tar.gz
PeerTube-71056d000864f0bc059626627772ddb61055f211.tar.zst
PeerTube-71056d000864f0bc059626627772ddb61055f211.zip
Fix hours in peertube-import-videos
Youtube doesn't store the hour of the publish date so set it to zero in order to compare it.
Diffstat (limited to 'server/tools/peertube-import-videos.ts')
-rw-r--r--server/tools/peertube-import-videos.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts
index 3c41a6c0c..b3c3aee3e 100644
--- a/server/tools/peertube-import-videos.ts
+++ b/server/tools/peertube-import-videos.ts
@@ -373,6 +373,7 @@ function parseDate (dateAsStr: string): Date {
373 exitError(`Invalid date passed: ${dateAsStr}. Expected format: YYYY-MM-DD. See help for usage.`); 373 exitError(`Invalid date passed: ${dateAsStr}. Expected format: YYYY-MM-DD. See help for usage.`);
374 } 374 }
375 const date = new Date(dateAsStr); 375 const date = new Date(dateAsStr);
376 date.setHours(0, 0, 0);
376 if (isNaN(date.getTime())) { 377 if (isNaN(date.getTime())) {
377 exitError(`Invalid date passed: ${dateAsStr}. See help for usage.`); 378 exitError(`Invalid date passed: ${dateAsStr}. See help for usage.`);
378 } 379 }