The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
show year if date is from previous years
Steven Tey5412f4beff37
diff --git a/lib/utils.ts b/lib/utils.tsindex b0833b1c7f..2f9d706cf7 100644--- a/lib/utils.ts+++ b/lib/utils.ts@@ -149,6 +149,10 @@ export const timeAgo = (timestamp?: Date): string => {return new Date(timestamp).toLocaleDateString("en-US", {month: "short",day: "numeric",+ year:+ new Date(timestamp).getFullYear() !== new Date().getFullYear()+ ? "numeric"+ : undefined,});}return ms(diff);