Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix date range increment function Closes #3828

Francis Caodae7327ed363
diff --git a/src/components/input/WebsiteDateFilter.tsx b/src/components/input/WebsiteDateFilter.tsx
index beb6f3711..18b4f13be 100644
--- a/src/components/input/WebsiteDateFilter.tsx
+++ b/src/components/input/WebsiteDateFilter.tsx
@@ -1,6 +1,6 @@
import { Button, Icon, ListItem, Row, Select, Text } from '@umami/react-zen';
import { isAfter } from 'date-fns';
-import { useCallback, useMemo } from 'react';
+import { useMemo } from 'react';
import { useDateRange, useDateRangeQuery, useMessages, useNavigation } from '@/components/hooks';
import { ChevronRight } from '@/components/icons';
import { getDateRangeValue } from '@/lib/date';
@@ -45,13 +45,9 @@ export function WebsiteDateFilter({
}
};
- const handleIncrement = useCallback(
- (increment: number) => {
- router.push(updateParams({ offset: +offset + increment }));
- },
- [offset],
- );
-
+ const handleIncrement = increment => {
+ router.push(updateParams({ offset: Number(offset) + increment }));
+ };
const handleSelect = (compare: any) => {
router.push(updateParams({ compare }));
};