Skip to content

Regression: Duration.normalize() not working properly after 3.4.1 #1493

@thomassth

Description

@thomassth

Describe the bug
See https://github.com/moment/luxon/actions/runs/5943754818/job/16119553727

- Expected  - 2
+ Received  + 2

  Object {
-   "days": 363,
-   "years": 1,
+   "days": -2,
+   "years": 2,
  }

- Expected  - 2
+ Received  + 2

  Object {
-   "days": 2,
-   "months": 0,
+   "days": -28,
+   "months": 1,
  }

Likely the fix for #1482 in 3.4.1 (11e454c) broke #1467

To Reproduce
Duration.fromObject({ hours: 96, minutes: 0, seconds: -10 }).normalize().toObject())
should equal { hours: 95, minutes: 59, seconds: 50} but no conversion happened.

Actual vs Expected behavior
All tests should be passing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions