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.

Fixed date filter.

Mike Cao7a5b5cc67871
diff --git a/components/input/WebsiteDateFilter.js b/components/input/WebsiteDateFilter.js
index 88f4bd859..917219744 100644
--- a/components/input/WebsiteDateFilter.js
+++ b/components/input/WebsiteDateFilter.js
@@ -13,7 +13,9 @@ export default function WebsiteDateFilter({ websiteId }) {
const data = await get(`/websites/${websiteId}`);
if (data) {
- setDateRange(`range:${new Date(data.createdAt)}:${Date.now()}`);
+ const start = new Date(data.createdAt).getTime();
+ const end = Date.now();
+ setDateRange(`range:${start}:${end}`);
}
} else if (value !== 'all') {
setDateRange(value);
@@ -27,6 +29,7 @@ export default function WebsiteDateFilter({ websiteId }) {
startDate={startDate}
endDate={endDate}
onChange={handleChange}
+ showAllTime={true}
/>
);
}
diff --git a/components/pages/reports/BaseParameters.js b/components/pages/reports/BaseParameters.js
index 5dbe0f603..394432cfa 100644
--- a/components/pages/reports/BaseParameters.js
+++ b/components/pages/reports/BaseParameters.js
@@ -33,7 +33,6 @@ export function BaseParameters() {
startDate={startDate}
endDate={endDate}
onChange={handleDateChange}
- showAllTime
/>
</FormRow>
</>
diff --git a/components/pages/websites/WebsiteMetricsBar.js b/components/pages/websites/WebsiteMetricsBar.js
index 12cab24b2..3683310c1 100644
--- a/components/pages/websites/WebsiteMetricsBar.js
+++ b/components/pages/websites/WebsiteMetricsBar.js
@@ -1,7 +1,6 @@
-import { useState } from 'react';
import classNames from 'classnames';
import { Row, Column } from 'react-basics';
-import { formatShortTime, formatNumber, formatLongNumber } from 'lib/format';
+import { formatShortTime } from 'lib/format';
import MetricCard from 'components/metrics/MetricCard';
import RefreshButton from 'components/input/RefreshButton';
import WebsiteDateFilter from 'components/input/WebsiteDateFilter';