Skip to content

Commit

Permalink
reintroduce changes from #47
Browse files Browse the repository at this point in the history
  • Loading branch information
slax57 committed Jun 28, 2024
1 parent 247a28f commit 4acb363
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions packages/demo/src/contacts/ContactListFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ import AccessTimeIcon from '@mui/icons-material/AccessTime';
import TrendingUpIcon from '@mui/icons-material/TrendingUp';
import LocalOfferIcon from '@mui/icons-material/LocalOffer';
import SupervisorAccountIcon from '@mui/icons-material/SupervisorAccount';
import { endOfYesterday, startOfWeek, startOfMonth, subMonths } from 'date-fns';
import {
endOfYesterday,
startOfWeek,
startOfMonth,
subMonths,
subWeeks,
} from 'date-fns';

import { Status } from '../misc/Status';

Expand Down Expand Up @@ -48,21 +54,34 @@ export const ContactListFilter = () => {
}}
/>
<FilterListItem
label="Before this week"
label="Last week"
value={{
'last_seen@gte': undefined,
'last_seen@gte': subWeeks(
startOfWeek(new Date()),
1
).toISOString(),
'last_seen@lte': startOfWeek(new Date()).toISOString(),
}}
/>
<FilterListItem
label="Before this month"
label="This month"
value={{
'last_seen@gte': undefined,
'last_seen@gte': startOfMonth(new Date()).toISOString(),
'last_seen@lte': undefined,
}}
/>
<FilterListItem
label="Last month"
value={{
'last_seen@gte': subMonths(
startOfMonth(new Date()),
1
).toISOString(),
'last_seen@lte': startOfMonth(new Date()).toISOString(),
}}
/>
<FilterListItem
label="Before last month"
label="Earlier"
value={{
'last_seen@gte': undefined,
'last_seen@lte': subMonths(
Expand Down

0 comments on commit 4acb363

Please sign in to comment.