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.

Update utils.ts

Steven Tey60b0cd7db642
diff --git a/apps/web/lib/analytics/utils.ts b/apps/web/lib/analytics/utils.ts
index 3d04eb2799..69ad304f35 100644
--- a/apps/web/lib/analytics/utils.ts
+++ b/apps/web/lib/analytics/utils.ts
@@ -22,9 +22,8 @@ export const validDateRangeForPlan = ({
interval === "1y" ||
interval === "ytd" ||
(start &&
- end &&
(getDaysDifference(start, new Date(Date.now())) > 30 ||
- getDaysDifference(start, end) > 30)))
+ getDaysDifference(start, end || new Date(Date.now())) > 30)))
) {
if (throwError) {
throw new DubApiError({
@@ -42,9 +41,8 @@ export const validDateRangeForPlan = ({
plan === "pro" &&
(interval === "all" ||
(start &&
- end &&
(getDaysDifference(start, new Date(Date.now())) > 365 ||
- getDaysDifference(start, end) > 365)))
+ getDaysDifference(start, end || new Date(Date.now())) > 365)))
) {
if (throwError) {
throw new DubApiError({