Fix estimated finish date adding to the wrong date

This commit is contained in:
baz 2025-05-05 02:39:36 +01:00
parent ce60955f37
commit 1d7c48f2ea

View File

@ -29,9 +29,8 @@ module.exports = {
const start = new Date(2024, 0, 1); const start = new Date(2024, 0, 1);
const days = (today - start) / (1000 * 60 * 60 * 24); const days = (today - start) / (1000 * 60 * 60 * 24);
const timepergame = days / beatenGamesDatabaseEntries.length; const timepergame = days / beatenGamesDatabaseEntries.length;
const finishdate = new Date(); start.setDate(start.getDate() + (timepergame * 100));
finishdate.setDate(start.getDate() + (timepergame * 100)); const formatteddate = start.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/');
const formatteddate = finishdate.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/');
desc = `${user.displayName} is estimated to finish the 100 Games Challenge on **${formatteddate}**.`; desc = `${user.displayName} is estimated to finish the 100 Games Challenge on **${formatteddate}**.`;
} }