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.

Subject: Invalid date error fixed

UsmanDev0950cab0e5d27c
diff --git a/packages/utils/src/functions/datetime.ts b/packages/utils/src/functions/datetime.ts
index 53316bd682..0f8693790f 100644
--- a/packages/utils/src/functions/datetime.ts
+++ b/packages/utils/src/functions/datetime.ts
@@ -26,6 +26,7 @@ export const formatDate = (datetime: Date | string) => {
};
export const formatDateTime = (datetime: Date | string) => {
+ if(datetime.toString() === 'Invalid Date') return ""
return new Date(datetime).toLocaleTimeString("en-US", {
month: "short",
day: "numeric",