mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
fix column name date bug
This commit is contained in:
parent
f84e41e198
commit
f5f6dc052e
@ -11,7 +11,7 @@ function mapData(data) {
|
|||||||
data?.reduce((obj, { timestamp }) => {
|
data?.reduce((obj, { timestamp }) => {
|
||||||
const t = startOfMinute(new Date(timestamp));
|
const t = startOfMinute(new Date(timestamp));
|
||||||
if (t.getTime() > last) {
|
if (t.getTime() > last) {
|
||||||
obj = { t: format(t, 'yyyy-LL-dd HH:mm:00'), y: 1 };
|
obj = { x: format(t, 'yyyy-LL-dd HH:mm:00'), y: 1 };
|
||||||
arr.push(obj);
|
arr.push(obj);
|
||||||
last = t.getTime();
|
last = t.getTime();
|
||||||
} else {
|
} else {
|
||||||
|
@ -181,8 +181,8 @@ export function getDateArray(data, startDate, endDate, unit) {
|
|||||||
const n = diff(endDate, startDate) + 1;
|
const n = diff(endDate, startDate) + 1;
|
||||||
|
|
||||||
function findData(date) {
|
function findData(date) {
|
||||||
const d = data.find(({ x, t }) => {
|
const d = data.find(({ x }) => {
|
||||||
return normalize(getDateFromString(x || t)).getTime() === date.getTime();
|
return normalize(getDateFromString(x)).getTime() === date.getTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
return d?.y || 0;
|
return d?.y || 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user