mirror of
https://github.com/JonnyBro/JaBa.git
synced 2025-01-19 17:03:47 +05:00
fix(models): birthdate on user has maybe null
This commit is contained in:
parent
4272ae63b0
commit
33363f64fc
2 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ export const data = {
|
|||
const user = users.find(u => u.id === userID);
|
||||
if (!user) return;
|
||||
|
||||
const userData = new Date(user.birthdate).getFullYear() <= 1970 ? new Date(user.birthdate * 1000) : new Date(user.birthdate);
|
||||
const userData = new Date(user.birthdate!).getFullYear() <= 1970 ? new Date(user.birthdate! * 1000) : new Date(user.birthdate!);
|
||||
const userYear = userData.getFullYear();
|
||||
const userMonth = userData.getMonth();
|
||||
const userDate = userData.getDate();
|
||||
|
|
|
@ -11,7 +11,7 @@ interface IUserSchema extends Document {
|
|||
id: string;
|
||||
rep: number;
|
||||
bio: string;
|
||||
birthdate: number;
|
||||
birthdate: number | null;
|
||||
lover: string;
|
||||
registeredAt: number;
|
||||
achievements: {
|
||||
|
|
Loading…
Reference in a new issue