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

Duration.shiftTo + Duration.normalize returns invalid value #1620

Open
Balkonskii opened this issue Apr 26, 2024 · 0 comments
Open

Duration.shiftTo + Duration.normalize returns invalid value #1620

Balkonskii opened this issue Apr 26, 2024 · 0 comments

Comments

@Balkonskii
Copy link

Balkonskii commented Apr 26, 2024

Describe the bug
Incorrect value when shifting the duration of days and months to years. For duration Duration.fromObject({ months: 12, days: 730 }) when using shiftTo and normalize, an incorrect value is returned.

To Reproduce
https://stackblitz.com/edit/jrxvkk?file=src%2Fapp%2Fapp.component.ts,package.json

Actual vs Expected behavior
Actual is { "years": 3, "months": 0, "days": 10, "hours": 0, "minutes": 0, "seconds": 0, "milliseconds": 0 }.
Expected is { "years": 3 }.

Desktop (please complete the following information):

  • OS: [Windows 11]
  • Browser [Chrome 124]
  • Luxon version [3.4.4]
  • Your timezone [GMT+7]

Additional context
Found it in unit test in my app. On luxon@3.4.1 it's pass, but from luxon@3.4.2 it's broken.

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