From 8e69e3b93312b4ed1bf42480885b23b5a06b6e4a Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sun, 12 May 2024 12:13:12 +0300 Subject: [PATCH] fix stats calculation - include repeating avs. --- pages/cart/publishers/stats.tsx | 18 +++++++++++------- src/helpers/data.js | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/pages/cart/publishers/stats.tsx b/pages/cart/publishers/stats.tsx index 9b91629..18ee50e 100644 --- a/pages/cart/publishers/stats.tsx +++ b/pages/cart/publishers/stats.tsx @@ -22,11 +22,11 @@ function ContactsPage({ allPublishers }) { const [pubWithAssignmentsCount, setPubWithAssignmentsCount] = useState(0); const [filteredPublishers, setFilteredPublishers] = useState(allPublishers); - const [sortField, setSortField] = useState('firstName'); + const [sortField, setSortField] = useState('name'); const [sortOrder, setSortOrder] = useState('asc'); const months = common.getMonthNames(); - const subsetMonths = Array.from({ length: 7 }, (_, i) => { + const subsetMonths = Array.from({ length: 9 }, (_, i) => { const monthIndex = (currentMonth - 3 + i + 12) % 12; // Adjust for year wrap-around return { name: months[monthIndex], @@ -104,7 +104,7 @@ function ContactsPage({ allPublishers }) {

Статистика

{pubWithAssignmentsCount} участника с предпочитания за месеца (от {filteredPublishers.length} )
- {/* Month dropdown */} - {/* Publisher type dropdown */} -