diff --git a/src/components/input/DateFilter.tsx b/src/components/input/DateFilter.tsx index 0c29afa6..afe44e6f 100644 --- a/src/components/input/DateFilter.tsx +++ b/src/components/input/DateFilter.tsx @@ -92,7 +92,7 @@ export function DateFilter({ const handleClose = () => setShowPicker(false); const renderValue = (value: string) => { - const { unit } = parseDateValue(value); + const { unit } = parseDateValue(value) || {}; if (offset && unit === 'year') { return formatDate(startDate, 'yyyy', locale); diff --git a/src/lib/date.ts b/src/lib/date.ts index 01cc1931..cf2f09df 100644 --- a/src/lib/date.ts +++ b/src/lib/date.ts @@ -260,7 +260,7 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) { const change = num * increment; const { add } = DATE_FUNCTIONS[unit]; - const { unit: originalUnit } = parseDateValue(value); + const { unit: originalUnit } = parseDateValue(value) || {}; switch (originalUnit) { case 'week':