Skip to content

Commit

Permalink
improve contact list filters
Browse files Browse the repository at this point in the history
  • Loading branch information
slax57 committed Jan 24, 2024
1 parent 147630d commit b531682
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/demo/src/contacts/ContactListFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import SupervisorAccountIcon from '@mui/icons-material/SupervisorAccount';
import {
endOfYesterday,
startOfWeek,
endOfWeek,
startOfMonth,
subMonths,
subWeeks,
} from 'date-fns';

import { Status } from '../misc/Status';
Expand Down Expand Up @@ -53,17 +53,20 @@ 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@lte': startOfMonth(new Date()).toISOString(),
'last_seen@gte': startOfMonth(new Date()).toISOString(),
'last_seen@lte': undefined,
}}
/>
<FilterListItem
Expand All @@ -77,7 +80,7 @@ export const ContactListFilter = () => {
}}
/>
<FilterListItem
label="Before last month"
label="Earlier"
value={{
'last_seen@gte': undefined,
'last_seen@lte': subMonths(
Expand Down

0 comments on commit b531682

Please sign in to comment.