Fixed "All time" and "Custom range" date selections.

This commit is contained in:
Mike Cao 2024-02-16 11:51:48 -08:00
parent 858864ef7f
commit a24e8b6396
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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':