Added more date filter options.

This commit is contained in:
Mike Cao 2024-03-22 14:35:41 -07:00
parent b873ea38ea
commit 09a161d04a
3 changed files with 12 additions and 3 deletions

View file

@ -182,8 +182,8 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
case 'month':
return {
startDate: subMonths(startOfMonth(now), num),
endDate: subMonths(endOfMonth(now), num),
unit: 'day',
endDate: subMonths(endOfMonth(now), num ? 1 : 0),
unit: num ? 'month' : 'day',
offset: 0,
num: num || 1,
value,