Skip to content

Test fail on 31/12 #1677

@guimard

Description

@guimard

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions