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.

fix invalid date error (#156)

Steven Tey0c87a8a82a57
diff --git a/components/app/modals/add-edit-link-modal/og-section.tsx b/components/app/modals/add-edit-link-modal/og-section.tsx
index d9b692332c..2c5b69237f 100644
--- a/components/app/modals/add-edit-link-modal/og-section.tsx
+++ b/components/app/modals/add-edit-link-modal/og-section.tsx
@@ -139,7 +139,9 @@ export default function OGSection({
/>
<div
className={`${
- dragActive ? "border-2 border-black bg-gray-50" : ""
+ dragActive
+ ? "cursor-copy border-2 border-black bg-gray-50 opacity-100"
+ : ""
} absolute z-[3] flex h-full w-full flex-col items-center justify-center rounded-md bg-white transition-all ${
image
? "opacity-0 group-hover:opacity-100"
diff --git a/lib/utils.ts b/lib/utils.ts
index e15d728e2e..319e07d05b 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -96,6 +96,7 @@ export const timeAgo = (timestamp: Date, timeOnly?: boolean): string => {
export const getDateTimeLocal = (timestamp?: Date): string => {
const d = timestamp ? new Date(timestamp) : new Date();
+ if (d.toString() === "Invalid Date") return "";
return new Date(d.getTime() - d.getTimezoneOffset() * 60000)
.toISOString()
.split(":")