From f7057160a0854fb644714a52a346485ef9f1a1f9 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Tue, 5 Nov 2024 18:02:08 +0500 Subject: [PATCH] make old dates backwards compatible --- helpers/birthdays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/birthdays.js b/helpers/birthdays.js index 96bce021..e943b142 100644 --- a/helpers/birthdays.js +++ b/helpers/birthdays.js @@ -27,7 +27,7 @@ module.exports.init = async client => { // Check if the user is in the guild if (!guild.members.cache.has(user.id)) continue; - const userDate = new Date(user.birthdate * 1000); + const userDate = user.birthdate > 9999999999 ? new Date(user.birthdate * 1000) : new Date(user.birthdate); const day = userDate.getDate(); const month = userDate.getMonth() + 1; const year = userDate.getFullYear();