Skip to content

Consistent date format#3884

Open
marcusljf wants to merge 1 commit into
mainfrom
partner-since-date
Open

Consistent date format#3884
marcusljf wants to merge 1 commit into
mainfrom
partner-since-date

Conversation

@marcusljf
Copy link
Copy Markdown
Collaborator

@marcusljf marcusljf commented May 11, 2026

Updating the date format for partner since on the partner details page. Now uses smart formatting and is shortened to be consistent with the other dates (identity verified and payout connection)

After

CleanShot 2026-05-11 at 15 53 27@2x

Before

CleanShot 2026-05-11 at 15 54 28@2x

Summary by CodeRabbit

  • Bug Fixes
    • Improved date and time formatting for the "Partner since / Applied" field in partner information cards for better readability.

Review Change Stack

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview May 11, 2026 11:05pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

The PartnerInfoCards component now displays partner creation dates using formatDateTimeSmart instead of formatDate, providing enhanced temporal context while preserving the conditional "Applied" vs "Partner since" label logic.

Changes

Partner Date Display

Layer / File(s) Summary
Partner Creation Date Formatting
apps/web/ui/partners/partner-info-cards.tsx
The createdAt field switches from formatDate(...) to formatDateTimeSmart(...) for improved temporal presentation, while the tooltip and conditional label logic remain unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • steven-tey

Poem

🐰 A date once plain, now gleams with smart delight,
From simple format to temporal insight,
The partners' histories now shine more bright,
Applied or since—the label stays just right! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Consistent date format' directly relates to the main change: updating the partner-since date formatting to use formatDateTimeSmart() for consistency across the partner details page.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch partner-since-date

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 94627f0 and a4f41e3.

📒 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)}`,
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant