mirror of
https://github.com/JonnyBro/JaBa.git
synced 2025-01-20 01:13: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);
|
const user = users.find(u => u.id === userID);
|
||||||
if (!user) return;
|
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 userYear = userData.getFullYear();
|
||||||
const userMonth = userData.getMonth();
|
const userMonth = userData.getMonth();
|
||||||
const userDate = userData.getDate();
|
const userDate = userData.getDate();
|
||||||
|
|
|
@ -11,7 +11,7 @@ interface IUserSchema extends Document {
|
||||||
id: string;
|
id: string;
|
||||||
rep: number;
|
rep: number;
|
||||||
bio: string;
|
bio: string;
|
||||||
birthdate: number;
|
birthdate: number | null;
|
||||||
lover: string;
|
lover: string;
|
||||||
registeredAt: number;
|
registeredAt: number;
|
||||||
achievements: {
|
achievements: {
|
||||||
|
|
Loading…
Reference in a new issue