Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix column name date bug

Francis Caof5f6dc052e12
diff --git a/components/metrics/RealtimeChart.js b/components/metrics/RealtimeChart.js
index 00bd00515..05da3cecf 100644
--- a/components/metrics/RealtimeChart.js
+++ b/components/metrics/RealtimeChart.js
@@ -11,7 +11,7 @@ function mapData(data) {
data?.reduce((obj, { timestamp }) => {
const t = startOfMinute(new Date(timestamp));
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);
last = t.getTime();
} else {
diff --git a/lib/date.js b/lib/date.js
index 13b19e360..6907786ca 100644
--- a/lib/date.js
+++ b/lib/date.js
@@ -181,8 +181,8 @@ export function getDateArray(data, startDate, endDate, unit) {
const n = diff(endDate, startDate) + 1;
function findData(date) {
- const d = data.find(({ x, t }) => {
- return normalize(getDateFromString(x || t)).getTime() === date.getTime();
+ const d = data.find(({ x }) => {
+ return normalize(getDateFromString(x)).getTime() === date.getTime();
});
return d?.y || 0;