Fixed "All time" and "Custom range" date selections.
This commit is contained in:
parent
858864ef7f
commit
a24e8b6396
|
@ -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);
|
||||
|
|
|
@ -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':
|
||||
|
|
Loading…
Reference in New Issue