From 937eabf1bdae045e6594df22a45f89c405cbd3c4 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Sat, 11 May 2024 15:16:53 +0500 Subject: [PATCH] add some hours to birthdate to remove confusion with timezones --- commands/Economy/birthdate.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/Economy/birthdate.js b/commands/Economy/birthdate.js index 30bdb845..7f20647a 100644 --- a/commands/Economy/birthdate.js +++ b/commands/Economy/birthdate.js @@ -75,8 +75,11 @@ class Birthdate extends BaseCommand { day = interaction.options.getInteger("day"), month = interaction.options.getInteger("month"), year = interaction.options.getInteger("year"), - date = new Date(year, month - 1, day), - d = Math.floor(date.getTime() / 1000); + date = new Date(year, month - 1, day); + + date.setHours(12); + + const d = Math.floor(date.getTime() / 1000); if (!(day == date.getDate() && month - 1 == date.getMonth() && year == date.getFullYear())) return interaction.error("economy/birthdate:INVALID_DATE"); if (date.getTime() > Date.now()) return interaction.error("economy/birthdate:DATE_TOO_HIGH");