Skip to content

Fix tiny-time-ago fallback strings, future tense and unit rounding - #18

Merged
arnelirobles merged 1 commit into
mainfrom
fix/tiny-time-ago-fallback
Nov 12, 2026
Merged

arnelirobles merged 1 commit into
mainfrom
fix/tiny-time-ago-fallback

Conversation

@arnelirobles

Copy link
Copy Markdown
Contributor

Fixes the plain parts of F8. The fallback formatter now prints the number for one unit ("1 minute ago", not "minute ago") and uses "in N ..." for future dates (es: "dentro de N ..."). The unit is picked after rounding, so 59.6 seconds reads "1 minute ago" instead of "60 seconds ago" (same for 24 hours, 7 days, 12 months). The old test that pinned the future-date limitation was changed to assert the new behaviour.

Not changed, a design decision: what an invalid date returns.

Tests: packages/tiny-time-ago/src/index.test.ts. 4 fail on main, all 18 pass here, tsc clean.

- test: packages/tiny-time-ago/src/index.test.ts
  breaks: packages/tiny-time-ago/src/index.ts "if (rounded < threshold.max) {"
- test: packages/tiny-time-ago/src/index.test.ts
  breaks: packages/tiny-time-ago/src/index.ts "return value > 0 ? strings.future(absValue, noun) : strings.past(absValue, noun);"

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d55c8cb-1cd9-4c1a-a360-620924577c48
Commits

Reviewing files that changed from the base of the PR and between 0f20b1a and 62e7007.

Files selected for processing: 3

  • .changeset/tiny-time-ago-fallback.md
  • packages/tiny-time-ago/src/index.test.ts
  • packages/tiny-time-ago/src/index.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@arnelirobles
arnelirobles marked this pull request as ready for review November 12, 2026 15:33
@arnelirobles
arnelirobles merged commit 1eed13a into main Nov 12, 2026
2 checks passed
@arnelirobles
arnelirobles deleted the fix/tiny-time-ago-fallback branch November 12, 2026 15:33
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