fix birthdays

This commit is contained in:
Jonny_Bro (Nikita) 2024-11-20 12:01:41 +05:00
parent 5a7088671f
commit e5c6659de5
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8

View file

@ -21,7 +21,7 @@ async function checkBirthdays(client) {
for (const user of users) { for (const user of users) {
if (!guild.members.cache.has(user.id)) continue; if (!guild.members.cache.has(user.id)) continue;
const userDate = user.birthdate > 9999999999 ? new Date(user.birthdate * 1000) : new Date(user.birthdate); const userDate = new Date(user.birthdate).getFullYear() <= 1970 ? new Date(user.birthdate * 1000) : new Date(user.birthdate);
const day = userDate.getDate(); const day = userDate.getDate();
const month = userDate.getMonth() + 1; const month = userDate.getMonth() + 1;
const year = userDate.getFullYear(); const year = userDate.getFullYear();