Skip to content

Round a past time the same way as the same time ahead - #98

Merged
rociiu merged 1 commit into
rociiu:mainfrom
rudycelekli:fix/relative-time-rounding
Oct 26, 2026
Merged

rociiu merged 1 commit into
rociiu:mainfrom
rudycelekli:fix/relative-time-rounding

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Summary

A note edited 90 minutes ago was labeled “1 hour ago”, while a reminder 90 minutes from now was labeled “in 2 hours”. The same split showed up at a day and a half: “yesterday” in the past, “in 2 days” ahead. Relative times now round a half away from zero in both directions, so 90 minutes ago is “2 hours ago” and 36 hours ago is “2 days ago”. Exactly one day ago is still “yesterday”.

Test

npm run test -w @talorys/web -- test/relative-time.test.ts

  • Before: fails. 90 minutes ago is “1 hour ago”, expected “2 hours ago”.
  • After: passes (2 tests).

Made with Cursor

@rociiu

rociiu commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Thanks @rudycelekli — clear write-up and a solid regression test. Merging!

@rociiu
rociiu merged commit e119d36 into rociiu:main Oct 26, 2026
1 check passed
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.

2 participants