From ed903796f1566c82d90fe1d2e1fc469f8f456442 Mon Sep 17 00:00:00 2001 From: baz Date: Tue, 28 Nov 2023 22:05:02 +0000 Subject: [PATCH] Change release_dates to first_release_date --- commands/100-games/searchGame.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commands/100-games/searchGame.js b/commands/100-games/searchGame.js index 88b4569..fa8bee4 100644 --- a/commands/100-games/searchGame.js +++ b/commands/100-games/searchGame.js @@ -20,10 +20,8 @@ module.exports = { let description = ''; for (const game of games) { - const release_dates = game['release_dates']; - if (release_dates && (game.category == 0 || game.category == 4)) { - const release_date = await getReleaseDates(release_dates[0]); - + if (game.first_release_date && (game.category == 0 || game.category == 4)) { + const release_date = new Intl.DateTimeFormat('en-GB', { dateStyle: 'long' }).format(game.first_release_date * 1000); description = description.concat(`- **${game.name}** (*${release_date}*) - ID: ${game.id} \n`); } }