Solved a bug on the stats page

This commit is contained in:
Tiago Ribeiro
2023-10-15 23:05:02 +01:00
parent 69425d0b93
commit 11777b1bea

View File

@@ -377,13 +377,7 @@ export default function Stats() {
<Chart <Chart
type="line" type="line"
data={{ data={{
labels: Object.keys( labels: Object.keys(groupBySession(stats)).map((_, index) => index),
groupBySession(
stats.filter(
(x) => moment.unix(x.date).isAfter(startDate) && moment.unix(x.date).isBefore(endDate),
),
),
).map((_, index) => index),
datasets: [ datasets: [
{ {
type: "line", type: "line",
@@ -406,13 +400,7 @@ export default function Stats() {
<Chart <Chart
type="line" type="line"
data={{ data={{
labels: Object.keys( labels: Object.keys(groupBySession(stats)).map((_, index) => index),
groupBySession(
stats.filter(
(x) => moment.unix(x.date).isAfter(startDate) && moment.unix(x.date).isBefore(endDate),
),
),
).map((_, index) => index),
datasets: [ datasets: [
...MODULE_ARRAY.map((module, index) => ({ ...MODULE_ARRAY.map((module, index) => ({
type: "line" as const, type: "line" as const,