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 buttons for today/yesterday selection.

Mike Cao87b947d17469
diff --git a/src/lib/date.ts b/src/lib/date.ts
index cf2f09df5..79dd89769 100644
--- a/src/lib/date.ts
+++ b/src/lib/date.ts
@@ -263,6 +263,13 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) {
const { unit: originalUnit } = parseDateValue(value) || {};
switch (originalUnit) {
+ case 'day':
+ return {
+ ...dateRange,
+ startDate: addDays(startDate, increment),
+ endDate: addDays(endDate, increment),
+ offset: offset + increment,
+ };
case 'week':
return {
...dateRange,