1
0
Fork 0

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.
This commit is contained in:
Florent F 2019-11-04 08:44:38 +01:00 committed by Chocobozzz
parent 532ea1fe22
commit 71056d0008
1 changed files with 1 additions and 0 deletions

View 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.`);
}