Consistent date format#3884
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe ChangesPartner Date Display
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with 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.
Inline comments:
In `@apps/web/ui/partners/partner-info-cards.tsx`:
- 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.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 48e760c8-b121-4a30-ab83-6c71636b17c2
📒 Files selected for processing (1)
apps/web/ui/partners/partner-info-cards.tsx
| 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)}`, |
There was a problem hiding this comment.
🧩 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.tsxRepository: dubinc/dub
Length of output: 50366
🏁 Script executed:
cat -n packages/utils/src/functions/datetime/format-datetime-smart.tsRepository: dubinc/dub
Length of output: 755
🏁 Script executed:
cat -n packages/utils/src/functions/datetime/format-date.tsRepository: 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.
| 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.
Updating the date format for
partner sinceon the partner details page. Now uses smart formatting and is shortened to be consistent with the other dates (identity verifiedandpayout connection)After
Before
Summary by CodeRabbit