Merge branch 'dev' into analytics
This commit is contained in:
@@ -111,7 +111,7 @@ export function Chart({
|
|||||||
} else {
|
} else {
|
||||||
const { index } = item;
|
const { index } = item;
|
||||||
const meta = chart.current.getDatasetMeta(0);
|
const meta = chart.current.getDatasetMeta(0);
|
||||||
const hidden = !!meta.data[index].hidden;
|
const hidden = !!meta?.data?.[index]?.hidden;
|
||||||
|
|
||||||
meta.data[index].hidden = !hidden;
|
meta.data[index].hidden = !hidden;
|
||||||
chart.current.legend.legendItems[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':
|
case 'day':
|
||||||
return {
|
return {
|
||||||
startDate: subDays(startOfDay(now), num),
|
startDate: subDays(startOfDay(now), num),
|
||||||
endDate: endOfDay(now),
|
endDate: subDays(endOfDay(now), num ? 1 : 0),
|
||||||
unit: num ? 'day' : 'hour',
|
unit: num ? 'day' : 'hour',
|
||||||
offset: 0,
|
offset: 0,
|
||||||
num: num || 1,
|
num: num || 1,
|
||||||
@@ -181,8 +181,8 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
|
|||||||
};
|
};
|
||||||
case 'month':
|
case 'month':
|
||||||
return {
|
return {
|
||||||
startDate: subMonths(startOfMonth(now), 1),
|
startDate: subMonths(startOfMonth(now), num),
|
||||||
endDate: subMonths(endOfMonth(now), 1),
|
endDate: subMonths(endOfMonth(now), num),
|
||||||
unit: 'day',
|
unit: 'day',
|
||||||
offset: 0,
|
offset: 0,
|
||||||
num: num || 1,
|
num: num || 1,
|
||||||
@@ -190,8 +190,8 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
|
|||||||
};
|
};
|
||||||
case 'year':
|
case 'year':
|
||||||
return {
|
return {
|
||||||
startDate: subYears(startOfYear(now), 1),
|
startDate: subYears(startOfYear(now), num),
|
||||||
endDate: subYears(endOfYear(now), 1),
|
endDate: subYears(endOfYear(now), num),
|
||||||
unit: 'month',
|
unit: 'month',
|
||||||
offset: 0,
|
offset: 0,
|
||||||
num: num || 1,
|
num: num || 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user