Skip to content

Commit

Permalink
feat: add last month preset to date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-harris authored and cdxker committed Jan 1, 2025
1 parent 7d85790 commit 9381222
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontends/shared/ui/DateRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
subMinutes,
subHours,
subDays,
subMonths,
} from "date-fns";
import { differenceInMinutes } from "date-fns/fp";

Expand Down Expand Up @@ -296,6 +297,17 @@ const defaultDatePresets: DatePreset[] = [
},
granularity: "day",
},
{
id: 8,
label: "Last Month",
range: {
gt: undefined,
lt: undefined,
lte: undefined,
gte: subMonths(new Date(), 1),
},
granularity: "day",
},
{
id: 9,
label: "All Time",
Expand Down

0 comments on commit 9381222

Please sign in to comment.