fix: use settings timezone in revenue chart date range

The revenue chart was using the browser's local timezone instead of
the timezone configured in Umami settings. This caused the chart to
show different time boundaries than the stats shown in the header
(total, average, transactions).

The fix mirrors the same pattern used by EventsChart: pass timezone
from useTimezone() into useDateRange() so that parseDateRange()
computes start/end dates relative to the correct timezone.

Fixes #4107
This commit is contained in:
Serhii Zghama committed 2026-03-25 16:39:50 +07:00
1 parent 0a838649b7
commit e6f3f3b4b4
1 file changed
+3 -2
@@ -1,13 +1,14 @@
'use client';
import { Column } from '@umami/react-zen';
import { WebsiteControls } from '@/app/(main)/websites/[websiteId]/WebsiteControls';
import { useDateRange } from '@/components/hooks';
import { useDateRange, useTimezone } from '@/components/hooks';
import { Revenue } from './Revenue';
export function RevenuePage({ websiteId }: { websiteId: string }) {
const { timezone } = useTimezone();
const {
dateRange: { startDate, endDate, unit },
} = useDateRange();
} = useDateRange({ timezone });
return (
<Column gap>