Consistent renewal date format + always show the live next renewal#10
Conversation
- formatSubscriptionDateTime now renders "MMM D, YYYY" (e.g. "Jun 8, 2026"), matching the "Started on" field and removing MM/DD ambiguity. - Subscription detail computes the next renewal live via getNextRenewal (rolling a passed date forward) instead of showing the raw stored value, so the displayed date and the countdown always agree and never show a stale/past date. - Add exhaustive next-renewal tests for every billing cycle (weekly → annual + custom), plus started-today and future-start cases. Note: for a sub started 2026-06-08 (monthly) viewed on 2026-07-13, the next renewal is correctly 2026-08-08 — the 07-08 charge has already passed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
Summary by CodeRabbit
WalkthroughThe subscription detail screen now computes next renewal dates and countdowns from live subscription data. Date formatting uses month names, and tests cover renewal roll-forward behavior across billing cycles and updated display formatting. ChangesRenewal display flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SubscriptionScreen
participant getNextRenewal
participant dayjs
SubscriptionScreen->>getNextRenewal: subscription renewal/start/billing-cycle inputs
getNextRenewal-->>SubscriptionScreen: nextRenewal
SubscriptionScreen->>dayjs: compare renewal startOf("day") with today
dayjs-->>SubscriptionScreen: daysLeft
SubscriptionScreen-->>SubscriptionScreen: render next renewal and countdown
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Note: for a sub started 2026-06-08 (monthly) viewed on 2026-07-13, the next renewal is correctly 2026-08-08 — the 07-08 charge has already passed.