]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix hours in peertube-import-videos
authorFlorent F <florent.fayolle69@gmail.com>
Mon, 4 Nov 2019 07:44:38 +0000 (08:44 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 4 Nov 2019 16:38:03 +0000 (17:38 +0100)
Youtube doesn't store the hour of the publish date so
set it to zero in order to compare it.

server/tools/peertube-import-videos.ts

index 3c41a6c0c097393d445c45c8d0d641a8dbf40d03..b3c3aee3e496a975bf8a4ad6c2e26df7022ebf73 100644 (file)
@@ -373,6 +373,7 @@ function parseDate (dateAsStr: string): Date {
     exitError(`Invalid date passed: ${dateAsStr}. Expected format: YYYY-MM-DD. See help for usage.`);
   }
   const date = new Date(dateAsStr);
+  date.setHours(0, 0, 0);
   if (isNaN(date.getTime())) {
     exitError(`Invalid date passed: ${dateAsStr}. See help for usage.`);
   }