Skip to content

Commit 962e43d

Browse files
committed
Update NewCustomers component to filter customers based on a 60-day timeframe
1 parent 169433d commit 962e43d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

react/react-admin/src/dashboard/NewCustomers.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ import { Customer } from '../types';
1616
const NewCustomers = () => {
1717
const translate = useTranslate();
1818

19-
const aMonthAgo = subDays(new Date(), 30);
20-
aMonthAgo.setDate(aMonthAgo.getDate() - 30);
21-
aMonthAgo.setHours(0);
22-
aMonthAgo.setMinutes(0);
23-
aMonthAgo.setSeconds(0);
24-
aMonthAgo.setMilliseconds(0);
19+
const startDate = subDays(new Date(), 60);
20+
startDate.setHours(0);
21+
startDate.setMinutes(0);
22+
startDate.setSeconds(0);
23+
startDate.setMilliseconds(0);
2524

2625
return (
2726
<ListBase
2827
resource="customers"
2928
filter={{
3029
has_ordered: true,
31-
first_seen_gte: aMonthAgo.toISOString(),
30+
first_seen_gte: startDate.toISOString(),
3231
}}
3332
sort={{ field: 'first_seen', order: 'DESC' }}
3433
perPage={100}

0 commit comments

Comments
 (0)