From 9df1de50192aa5758997bd8ea3f8b1da0008a276 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Tue, 31 Aug 2021 16:02:54 +0200 Subject: [PATCH] Fix l'affichage des stats de satisfaction globale le 31 du mois --- mon-entreprise/source/pages/Stats/GlobalStats.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mon-entreprise/source/pages/Stats/GlobalStats.tsx b/mon-entreprise/source/pages/Stats/GlobalStats.tsx index 62cfaf73a..79e928370 100644 --- a/mon-entreprise/source/pages/Stats/GlobalStats.tsx +++ b/mon-entreprise/source/pages/Stats/GlobalStats.tsx @@ -1,8 +1,8 @@ import emoji from 'react-easy-emoji' -import { Indicators, Indicator } from './utils' -import { SatisfactionLevel, StatsStruct } from './types' import { useTranslation } from 'react-i18next' import { SatisfactionStyle } from './SatisfactionChart' +import { SatisfactionLevel, StatsStruct } from './types' +import { Indicator, Indicators } from './utils' const add = (a: number, b: number) => a + b const lastCompare = (startDate: Date, dateStr: string) => @@ -105,7 +105,7 @@ export default function GlobalStats({ stats }: { stats: StatsStruct }) { const last30dConv = Math.round((100 * last30dCommenceNum) / last30dVisitsNum) const last30dSatisfactions = stats.satisfaction - .filter(({ date }) => lastCompare(day30before, date)) + .filter(({ date }) => date.startsWith(new Date().toISOString().slice(0, 7))) .reduce( (acc, { click: satisfactionLevel, nombre }) => ({ ...acc, @@ -183,7 +183,7 @@ export default function GlobalStats({ stats }: { stats: StatsStruct }) { } - footnote={`${last30dSatisfactionTotal} avis sur les 30 derniers jours`} + footnote={`${last30dSatisfactionTotal} avis ce mois ci`} width="75%" />