Merge pull request #9034 from PhilLecl/master

Fix date range in userGamesDownload
mailer
Thibault Duplessis 2021-05-27 09:06:09 +02:00 committed by GitHub
commit 3c4304ed57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ function generateSearchParams(): string {
if (date.length == 10) {
// the 00:00:00 is necessary for the time to be interpreted in the local timezone
const datetime = new Date(`${date} ${time.length == 8 ? time : '00:00:00'}`);
// If no time is specified, assume that all games on that day should be included
if (time.length != 8) datetime.setDate(datetime.getDate() + 1);
// Include all games played on date-until if no time is specified
if (time.length != 8 && name === 'until') datetime.setDate(datetime.getDate() + 1);
searchParams.append(name, Math.max(datetime.getTime(), minTimestamp).toString());
}
});