Skip to content
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

Test fail on 31/12 #1677

Open
guimard opened this issue Jan 1, 2025 · 0 comments
Open

Test fail on 31/12 #1677

guimard opened this issue Jan 1, 2025 · 0 comments

Comments

@guimard
Copy link

guimard commented Jan 1, 2025

Describe the bug

The test fail on 31/12. Here is a simple patch:

--- a/test/datetime/relative.test.js
+++ b/test/datetime/relative.test.js
@@ -121,7 +121,9 @@
 test("DateTime#toRelativeCalendar picks the correct unit with no options", () => {
   const now = DateTime.now();
   const isLastDayOfMonth = now.endOf("month").day === now.day;
+  const isLastDayOfYear = now.endOf("year").day === now.day;
   expect(now.plus({ days: 1 }).toRelativeCalendar()).toBe(
+    isLastDayOfYear ? "next year" :
     isLastDayOfMonth ? "next month" : "tomorrow"
   );
 });

Reported by Debian: https://bugs.debian.org/109810

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

No branches or pull requests

1 participant