make old dates backwards compatible

This commit is contained in:
Jonny_Bro (Nikita) 2024-11-05 18:02:08 +05:00
parent d34c5cee09
commit f7057160a0
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8

View file

@ -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();