Skip to content

Commit

Permalink
mobile: StatisticsTab: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed Apr 20, 2024
1 parent 812065a commit 96b2951
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions mobile/Components/StatisticsTab/StatisticsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,6 @@ const StatisticsTab = () => {
}, []),
);

const booksReadByMonth = activity.reduce((acc, cur) => {
const monthYear = cur.timestamp.substr(0, 7); // timestamp format YYYY-MM-DDTHH:MM:SS
acc[monthYear] = (acc[monthYear] || 0) + 1;
return acc;
}, {});

const sortedBooksByMonth = Object.entries(booksReadByMonth).sort(
(a, b) => new Date(a[0]).getMonth() - new Date(b[0]).getMonth(),
);
// const mostReadMonth =
// sortedBooksByMonth.length > 0
// ? sortedBooksByMonth[sortedBooksByMonth.length - 1][0]
// : null;

const authorsRead = activity.reduce((acc, cur) => {
const author = cur.book.author;
acc[author] = (acc[author] || 0) + 1;
Expand Down

0 comments on commit 96b2951

Please sign in to comment.