Skip to content

Commit

Permalink
Updated date picker presets
Browse files Browse the repository at this point in the history
  • Loading branch information
jaieds committed Jan 6, 2025
1 parent c3e68f0 commit 10d7e3a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/components/datepicker/datepicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import {
endOfWeek,
startOfMonth,
endOfMonth,
subWeeks,
subMonths,
subDays,
} from 'date-fns';
import { getDefaultSelectedValue } from './utils';
import { type PropsBase } from 'react-day-picker';
Expand Down Expand Up @@ -113,10 +112,10 @@ const DatePicker = ( {
},
},
{
label: 'Last Week',
label: 'Last 7 Days',
range: {
from: startOfWeek( subWeeks( new Date(), 1 ), { weekStartsOn: 1 } ),
to: endOfWeek( subWeeks( new Date(), 1 ), { weekStartsOn: 1 } ),
from: subDays( new Date(), 6 ),
to: new Date(),
},
},
{
Expand All @@ -127,10 +126,10 @@ const DatePicker = ( {
},
},
{
label: 'Last Month',
label: 'Last 30 Days',
range: {
from: startOfMonth( subMonths( new Date(), 1 ) ),
to: endOfMonth( subMonths( new Date(), 1 ) ),
from: subDays( new Date(), 29 ),
to: new Date(),
},
},
];
Expand Down

0 comments on commit 10d7e3a

Please sign in to comment.