-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"X years ago" is not rounding correctly #270
Comments
Some light investigation suggests that the problem is in diff --git a/test/duration.ts b/test/duration.ts
index ef96d97..e6c6aaf 100644
--- a/test/duration.ts
+++ b/test/duration.ts
@@ -309,6 +309,7 @@ suite('duration', function () {
},
],
['-P27D', '-P1M', {relativeTo: new Date('2023-02-28T00:00:00Z')}],
+ [{days: -15, months: -11}, '-P1Y', {relativeTo: new Date('2024-01-06T00:00:00')}],
])
for (const [input, expected, opts] of roundTests) {
test(`roundToSingleUnit(${input}) === ${expected}`, () => { |
I think I ran into a similar issue: This screenshot has been taken from a Gitea instance. Gitea uses relative-time-element to display, well, relative dates. |
I noticed that something from Feb 2020 displayed as "5 years ago", when it is closer to 4 years if we are trying to round?
The text was updated successfully, but these errors were encountered: