Skip to content

Commit 1f3e96a

Browse files
committed
Fix most active/inactive days
1 parent 138310b commit 1f3e96a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/compositions/all-tab-list-summary.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ function fillMostListWithoutToday(days: TabDay[]) {
115115
});
116116

117117
if (sortedByTimeDaysWithoutToday.length == 0) return null;
118-
const mostActiveDayExceptToday = sortedByTimeDaysWithoutToday[0];
118+
const mostActiveDayExceptToday =
119+
sortedByTimeDaysWithoutToday[sortedByTimeDaysWithoutToday.length - 1];
119120
const mostActiveDayObjExceptToday = fillMostDay(mostActiveDayExceptToday);
120121

121-
const mostInactiveDayExceptToday =
122-
sortedByTimeDaysWithoutToday[sortedByTimeDaysWithoutToday.length - 1];
122+
const mostInactiveDayExceptToday = sortedByTimeDaysWithoutToday[0];
123123
const mostInactiveDayObjExceptToday = fillMostDay(mostInactiveDayExceptToday);
124124

125125
return {
@@ -133,10 +133,10 @@ function fillMostList(days: TabDay[]) {
133133
return a.summary - b.summary;
134134
});
135135

136-
const mostActiveDay = sortedByTimeDays[0];
136+
const mostActiveDay = sortedByTimeDays[sortedByTimeDays.length - 1];
137137
const mostActiveDayObj = fillMostDay(mostActiveDay);
138138

139-
const mostInactiveDay = sortedByTimeDays[sortedByTimeDays.length - 1];
139+
const mostInactiveDay = sortedByTimeDays[0];
140140
const mostInactiveDayObj = fillMostDay(mostInactiveDay);
141141

142142
return {

0 commit comments

Comments
 (0)