From 44be8009fd3e11daf30e2c80a6ee2a8c6f85af08 Mon Sep 17 00:00:00 2001 From: charlesgauthereau Date: Thu, 7 Aug 2025 16:23:06 +0200 Subject: [PATCH] Bug on stats. --- .../(organization)/statistics/page.tsx | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/app/(customer)/dashboard/(organization)/statistics/page.tsx b/app/(customer)/dashboard/(organization)/statistics/page.tsx index 0de063ce..109ee54a 100644 --- a/app/(customer)/dashboard/(organization)/statistics/page.tsx +++ b/app/(customer)/dashboard/(organization)/statistics/page.tsx @@ -50,6 +50,9 @@ export default async function RoutePage(props: PageParams<{}>) { // const tomorrow = new Date(); // tomorrow.setDate(tomorrow.getDate() + 1); // + // const before = new Date(); + // before.setDate(before.getDate() - 1); + // // const backupsEvolution = [ // { // id: '22e84aa4-228c-45b3-82ec-846a639cd509', @@ -60,10 +63,22 @@ export default async function RoutePage(props: PageParams<{}>) { // createdAt: new Date() // }, // { - // id: '6a6106fe-7f45-48eb-a56f-0a1e734126a1', + // id: '2c114dc3-1fa6-4ef1-972c-9765c65e9331', // createdAt: new Date() // }, // { + // id: '2c114dc3-1fa6-4ef1-972c-9765c65e9331', + // createdAt: new Date() + // }, + // { + // id: '2c114dc3-1fa6-4ef1-972c-9765c65e9331', + // createdAt: new Date(before) + // }, + // { + // id: '6a6106fe-7f45-48eb-a56f-0a1e734126a1', + // createdAt: new Date(before) + // }, + // { // id: 'a529d790-502e-4609-ad37-9b1c00c73477', // createdAt: new Date() // }, @@ -76,6 +91,14 @@ export default async function RoutePage(props: PageParams<{}>) { // createdAt: new Date() // }, // { + // id: 'f1d5a4e2-1c33-41c4-932b-02456c2a6f1d', + // createdAt: new Date(tomorrow) + // }, + // { + // id: 'f1d5a4e2-1c33-41c4-932b-02456c2a6f1d', + // createdAt: new Date(tomorrow) + // }, + // { // id: 'e88a588a-2353-4470-9976-8c3eb2ffc88d', // createdAt: new Date() // }, @@ -123,6 +146,10 @@ export default async function RoutePage(props: PageParams<{}>) { const backupsEvolutionCount = backupsEvolution.length; + const sortedBackupsEvolution = backupsEvolution.sort( + (a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime() + ); + return ( @@ -158,7 +185,7 @@ export default async function RoutePage(props: PageParams<{}>) { Evolution of the number of backups - +