mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-24 19:10:21 +01:00
Merge branch 'dev' into analytics
This commit is contained in:
commit
1de3ae4526
@ -111,7 +111,7 @@ export function Chart({
|
||||
} else {
|
||||
const { index } = item;
|
||||
const meta = chart.current.getDatasetMeta(0);
|
||||
const hidden = !!meta.data[index].hidden;
|
||||
const hidden = !!meta?.data?.[index]?.hidden;
|
||||
|
||||
meta.data[index].hidden = !hidden;
|
||||
chart.current.legend.legendItems[index].hidden = !hidden;
|
||||
|
@ -164,7 +164,7 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
|
||||
case 'day':
|
||||
return {
|
||||
startDate: subDays(startOfDay(now), num),
|
||||
endDate: endOfDay(now),
|
||||
endDate: subDays(endOfDay(now), num ? 1 : 0),
|
||||
unit: num ? 'day' : 'hour',
|
||||
offset: 0,
|
||||
num: num || 1,
|
||||
@ -181,8 +181,8 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
|
||||
};
|
||||
case 'month':
|
||||
return {
|
||||
startDate: subMonths(startOfMonth(now), 1),
|
||||
endDate: subMonths(endOfMonth(now), 1),
|
||||
startDate: subMonths(startOfMonth(now), num),
|
||||
endDate: subMonths(endOfMonth(now), num),
|
||||
unit: 'day',
|
||||
offset: 0,
|
||||
num: num || 1,
|
||||
@ -190,8 +190,8 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
|
||||
};
|
||||
case 'year':
|
||||
return {
|
||||
startDate: subYears(startOfYear(now), 1),
|
||||
endDate: subYears(endOfYear(now), 1),
|
||||
startDate: subYears(startOfYear(now), num),
|
||||
endDate: subYears(endOfYear(now), num),
|
||||
unit: 'month',
|
||||
offset: 0,
|
||||
num: num || 1,
|
||||
|
Loading…
Reference in New Issue
Block a user