Skip to content

fix: make engineer tenure timezone independent - #504

Merged
Shramkoweb merged 4 commits into
mainfrom
fix/engineer-tenure-timezone
Jul 19, 2026
Merged

fix: make engineer tenure timezone independent#504
Shramkoweb merged 4 commits into
mainfrom
fix/engineer-tenure-timezone

Conversation

@Shramkoweb

Copy link
Copy Markdown
Owner

Summary

  • The "Time as Software Engineer" dashboard card showed 8y, 0m instead of 7y, 11m for any viewer west of UTC: new Date('2018-08-01') parses as UTC midnight but was read back with local-time getters, shifting the anchor date to Jul 31. The duration is now computed entirely in UTC, includes days (7y, 11m, 18d), and is calculated after mount so the statically prerendered HTML never mismatches on hydration.
  • Calendar math extracted to lib/calendar.ts as calendarDurationBetween(); month-end anchors cap to shorter months (date-fns convention), fixing a latent negative-days bug (Jan 31 → Mar 1 returned days: -1).
  • Naming aligned with the UI language: TimeAsSoftwareEngineer (was DaysAsSoftwareEngineer), CAREER_START_DATE (was DATE_OF_CREATION, which collided with YEAR_OF_CREATE meaning the site launch).

Type

  • fix — bug fix

Linked spec or plan

None.

Test plan

  • pnpm verify:full exits 0 locally
  • Unit tests cover timezone independence, anniversary rollover, day borrowing, and month-end capping (lib/calendar.test.ts); component test pins the rendered format
  • After deploy: open /dashboard in a UTC-negative timezone (e.g. America/New_York) and confirm the card shows 7y, 11m, Xd

Breaking changes

None.

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
portfolio Error Error Jul 19, 2026 11:42pm

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Shramkoweb, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 670c001c-6b35-45d8-8f84-f9fce46af840

📥 Commits

Reviewing files that changed from the base of the PR and between 7c7154e and 1d98b74.

📒 Files selected for processing (6)
  • components/dashboard-card/days-as-engineer.tsx
  • components/dashboard-card/time-as-engineer.test.tsx
  • components/dashboard-card/time-as-engineer.tsx
  • lib/calendar.test.ts
  • lib/calendar.ts
  • pages/dashboard.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/engineer-tenure-timezone

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.

@Shramkoweb
Shramkoweb merged commit 0ec3426 into main Jul 19, 2026
11 of 12 checks passed
@Shramkoweb
Shramkoweb deleted the fix/engineer-tenure-timezone branch July 19, 2026 23:43
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