Fix estimated finish date adding to the wrong date
This commit is contained in:
parent
ce60955f37
commit
1d7c48f2ea
@ -29,9 +29,8 @@ module.exports = {
|
||||
const start = new Date(2024, 0, 1);
|
||||
const days = (today - start) / (1000 * 60 * 60 * 24);
|
||||
const timepergame = days / beatenGamesDatabaseEntries.length;
|
||||
const finishdate = new Date();
|
||||
finishdate.setDate(start.getDate() + (timepergame * 100));
|
||||
const formatteddate = finishdate.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/');
|
||||
start.setDate(start.getDate() + (timepergame * 100));
|
||||
const formatteddate = start.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}**.`;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user