feat(frontend, backend): Show profile created date

This commit is contained in:
Aleksander Wilczyński 2024-12-12 11:52:32 +01:00
parent 67e12b8179
commit 01c5fe21c2
Signed by untrusted user: alekswilc
GPG Key ID: D4464A248E5F27FE
5 changed files with 7 additions and 5 deletions

View File

@ -58,7 +58,8 @@ export class ProfilesRoute
new SuccessResponseBuilder() new SuccessResponseBuilder()
.setCode(200) .setCode(200)
.setData({ .setData({
player player,
createdAt: player._id.getTimestamp().getTime()
}) })
.toJSON(), .toJSON(),
); );

View File

@ -24,7 +24,7 @@ import { useAuth } from "../../../hooks/useAuth.tsx";
import { ConfirmModal } from "../../mini/modal/ConfirmModal.tsx"; import { ConfirmModal } from "../../mini/modal/ConfirmModal.tsx";
import { post } from "../../../util/fetcher.ts"; import { post } from "../../../util/fetcher.ts";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import dayjs from 'dayjs';
export const ProfileCard = ({ data }: { data: TProfileData }) => export const ProfileCard = ({ data }: { data: TProfileData }) =>
{ {
@ -244,7 +244,7 @@ export const ProfileCard = ({ data }: { data: TProfileData }) =>
<div className="shadow-default dark:bg-boxdark items-center justify-center p-2.5 flex flex-col xl:p-5 gap-2"> <div className="shadow-default dark:bg-boxdark items-center justify-center p-2.5 flex flex-col xl:p-5 gap-2">
<h1 className="text-sm text-black dark:text-white"> <h1 className="text-sm text-black dark:text-white">
{t("profile.info")} {t("profile.info", { date: dayjs(data.createdAt).format('DD/MM/YYYY') })}
</h1> </h1>
</div> </div>

View File

@ -100,7 +100,7 @@
"description": "The player's profile could not be displayed due to active moderator actions." "description": "The player's profile could not be displayed due to active moderator actions."
} }
}, },
"info": "Note: We have been collecting statistics since 13/12/2024." "info": "Note: This user's statistics are collected since {{date}}."
}, },
"log": { "log": {
"errors": { "errors": {

View File

@ -100,7 +100,7 @@
"description": "Profil gracza nie mógł zostać wyświetlony ze względu na aktywne działania moderatora." "description": "Profil gracza nie mógł zostać wyświetlony ze względu na aktywne działania moderatora."
} }
}, },
"info": "Uwaga: Gromadzimy statystyki od 13.12.2024 r." "info": "Uwaga: Statystyki tego użytkownika gromadzone są od {{date}} r."
}, },
"log": { "log": {
"errors": { "errors": {

View File

@ -33,6 +33,7 @@ export interface TProfileSuccessResponse
export interface TProfileData export interface TProfileData
{ {
player: TProfilePlayer; player: TProfilePlayer;
createdAt: number
} }
export interface TProfilePlayer export interface TProfilePlayer