Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/ui/partners/partner-info-cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function PartnerInfoCards({
{
id: "createdAt",
icon: <Users className="size-3.5" />,
text: `${"status" in partner && partner.status === "pending" ? "Applied" : "Partner since"} ${formatDate(partner.createdAt)}`,
text: `${"status" in partner && partner.status === "pending" ? "Applied" : "Partner since"} ${formatDateTimeSmart(partner.createdAt)}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify formatter semantics and current call sites (read-only).
# 1) Locate formatDateTimeSmart implementation in the repo/packages.
fd -i "utils" | head -n 20
rg -n -C3 '\bformatDateTimeSmart\b' 

# 2) Compare usage patterns in partners UI for consistency.
rg -n -C2 'Partner since|Applied|Identity verified|connected' apps/web/ui/partners/partner-info-cards.tsx

Repository: dubinc/dub

Length of output: 50366


🏁 Script executed:

cat -n packages/utils/src/functions/datetime/format-datetime-smart.ts

Repository: dubinc/dub

Length of output: 755


🏁 Script executed:

cat -n packages/utils/src/functions/datetime/format-date.ts

Repository: dubinc/dub

Length of output: 440


🏁 Script executed:

# Check the actual formatting patterns in partner-info-cards.tsx around the area in question
cat -n apps/web/ui/partners/partner-info-cards.tsx | sed -n '130,180p'

Repository: dubinc/dub

Length of output: 2281


🏁 Script executed:

# Continue reading to see how identityVerifiedAt is formatted
cat -n apps/web/ui/partners/partner-info-cards.tsx | sed -n '180,195p'

Repository: dubinc/dub

Length of output: 629


Use formatDate with { month: "short" } option for date-only formatting in "Applied/Partner since" label.

Line 149 uses formatDateTimeSmart(partner.createdAt), which displays time for recent timestamps (current year) and only the date for past years. This produces inconsistent UI output. The identityVerifiedAt field at line 181 uses formatDate(..., { month: "short" }) for date-only display. Apply the same pattern here.

Suggested change
-        text: `${"status" in partner && partner.status === "pending" ? "Applied" : "Partner since"} ${formatDateTimeSmart(partner.createdAt)}`,
+        text: `${"status" in partner && partner.status === "pending" ? "Applied" : "Partner since"} ${formatDate(partner.createdAt, { month: "short" })}`,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
text: `${"status" in partner && partner.status === "pending" ? "Applied" : "Partner since"} ${formatDateTimeSmart(partner.createdAt)}`,
text: `${"status" in partner && partner.status === "pending" ? "Applied" : "Partner since"} ${formatDate(partner.createdAt, { month: "short" })}`,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/ui/partners/partner-info-cards.tsx` at line 149, Replace the
inconsistent call to formatDateTimeSmart for the "Applied/Partner since" label:
in the template that currently uses formatDateTimeSmart(partner.createdAt)
(within the text property that checks "status" in partner), call
formatDate(partner.createdAt, { month: "short" }) instead so the label shows
date-only with short month formatting (same pattern used for
identityVerifiedAt). Leave the status logic ("status" in partner &&
partner.status === "pending" ? "Applied" : "Partner since") unchanged; only swap
the formatter function and options.

timestamp: partner.createdAt,
},
{
Expand Down
Loading