mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 18:00:17 +01:00
Merge branch 'analytics' into dev
This commit is contained in:
commit
b76f4aa42d
@ -26,7 +26,7 @@ export function useWebsitePageviews(websiteId: string, options?: { [key: string]
|
|||||||
};
|
};
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['websites:pageviews', params],
|
queryKey: ['websites:pageviews', { websiteId, ...params }],
|
||||||
queryFn: () => get(`/websites/${websiteId}/pageviews`, params),
|
queryFn: () => get(`/websites/${websiteId}/pageviews`, params),
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ export function useWebsiteStats(websiteId: string, options?: { [key: string]: st
|
|||||||
};
|
};
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['websites:stats', params],
|
queryKey: ['websites:stats', { websiteId, ...params }],
|
||||||
queryFn: () => get(`/websites/${websiteId}/stats`, params),
|
queryFn: () => get(`/websites/${websiteId}/stats`, params),
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
|
@ -92,7 +92,7 @@ export function DateFilter({
|
|||||||
const handleClose = () => setShowPicker(false);
|
const handleClose = () => setShowPicker(false);
|
||||||
|
|
||||||
const renderValue = (value: string) => {
|
const renderValue = (value: string) => {
|
||||||
const { unit } = parseDateValue(value);
|
const { unit } = parseDateValue(value) || {};
|
||||||
|
|
||||||
if (offset && unit === 'year') {
|
if (offset && unit === 'year') {
|
||||||
return formatDate(startDate, 'yyyy', locale);
|
return formatDate(startDate, 'yyyy', locale);
|
||||||
|
@ -260,7 +260,7 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) {
|
|||||||
|
|
||||||
const change = num * increment;
|
const change = num * increment;
|
||||||
const { add } = DATE_FUNCTIONS[unit];
|
const { add } = DATE_FUNCTIONS[unit];
|
||||||
const { unit: originalUnit } = parseDateValue(value);
|
const { unit: originalUnit } = parseDateValue(value) || {};
|
||||||
|
|
||||||
switch (originalUnit) {
|
switch (originalUnit) {
|
||||||
case 'week':
|
case 'week':
|
||||||
|
Loading…
Reference in New Issue
Block a user