Skip to content

Commit 950b8ee

Browse files
Adez017Copilot
andauthored
Update src/lib/statsProvider.tsx
Co-authored-by: Copilot <[email protected]>
1 parent b73da1d commit 950b8ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/statsProvider.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ const getTimeFilterDate = (filter: TimeFilter): Date | null => {
102102
switch (filter) {
103103
case 'week':
104104
return new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
105-
case 'month':
106-
return new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
105+
case 'month': {
106+
const lastMonth = new Date(now);
107+
lastMonth.setMonth(now.getMonth() - 1);
108+
return lastMonth;
109+
}
107110
case 'year':
108111
return new Date(now.getTime() - 365 * 24 * 60 * 60 * 1000);
109112
case 'all':

0 commit comments

Comments
 (0)