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.

Disable filter on custom range.

Brian Caocf1dd422fee7
diff --git a/src/components/input/WebsiteDateFilter.js b/src/components/input/WebsiteDateFilter.js
index a8403db6c..6903a7085 100644
--- a/src/components/input/WebsiteDateFilter.js
+++ b/src/components/input/WebsiteDateFilter.js
@@ -9,7 +9,9 @@ export function WebsiteDateFilter({ websiteId }) {
const [dateRange, setDateRange] = useDateRange(websiteId);
const { value, startDate, endDate, selectedUnit } = dateRange;
const isFutureDate =
- value !== 'all' && isAfter(incrementDateRange(dateRange, -1).startDate, new Date());
+ value !== 'all' &&
+ selectedUnit &&
+ isAfter(incrementDateRange(dateRange, -1).startDate, new Date());
const handleChange = value => {
setDateRange(value);
@@ -21,7 +23,7 @@ export function WebsiteDateFilter({ websiteId }) {
return (
<Flexbox justifyContent="center" gap={10}>
- {value !== 'all' && (
+ {value !== 'all' && selectedUnit && (
<Flexbox justifyContent="center" className={styles.buttons}>
<Button onClick={() => handleIncrement(1)}>
<Icon rotate={90}>