Duration shiftTo seems to produce wrong result when upgrading to latest #1558
Unanswered
HarryDavisgithub
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get the difference between two days as a ISO 8601 Duration string. I want this to take into account leap years. I recently upgraded from
luxon: "^1.26.0"
, to3.4.4
and the code in function1 no longer gave the same result as it did before.I would expect "2020-01-01" to "2050-01-01" to give P30Y8D
Function2 is my attempt at a solution but does not seem to take into account leap years.
https://codesandbox.io/p/sandbox/boring-sound-h2r35k?file=%2Fsrc%2Findex.ts
Please let me know if anyone has any suggestions, or if my logic/thinking is wrong here.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions