mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
commit
cecdf49180
4 changed files with 4 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue