Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Made 90d and all-time intervals month granularity

Steven Tey070b4f04c7ed
diff --git a/app/ui/stats/bar-chart.tsx b/app/ui/stats/bar-chart.tsx
index 1e4a790e8c..f428f4d31c 100644
--- a/app/ui/stats/bar-chart.tsx
+++ b/app/ui/stats/bar-chart.tsx
@@ -89,6 +89,12 @@ export default function BarChart() {
hour: "numeric",
})
.replace(",", " ");
+ case "90d":
+ case "all":
+ return new Date(e).toLocaleDateString("en-us", {
+ month: "short",
+ year: "numeric",
+ });
default:
return new Date(e).toLocaleDateString("en-us", {
month: "short",
diff --git a/components/stats/bar-chart.tsx b/components/stats/bar-chart.tsx
index 86b0a618b9..208ae22526 100644
--- a/components/stats/bar-chart.tsx
+++ b/components/stats/bar-chart.tsx
@@ -94,6 +94,12 @@ const BarChart = ({ screenWidth }: { screenWidth?: number }) => {
hour: "numeric",
})
.replace(",", " ");
+ case "90d":
+ case "all":
+ return new Date(e).toLocaleDateString("en-us", {
+ month: "short",
+ year: "numeric",
+ });
default:
return new Date(e).toLocaleDateString("en-us", {
month: "short",
diff --git a/lib/stats.ts b/lib/stats.ts
index e6ba79c5bf..48c50cd289 100644
--- a/lib/stats.ts
+++ b/lib/stats.ts
@@ -48,12 +48,12 @@ export const intervalData = {
},
"90d": {
startDate: new Date(Date.now() - 7776000000),
- granularity: "day",
+ granularity: "month",
},
all: {
// Dub.sh founding date
startDate: new Date("2022-09-22"),
- granularity: "day",
+ granularity: "month",
},
};