Uh oh!
There was an error while loading. Please reload this page.
add test cases for superfluous days - #263
Conversation
primer-css
commented
Jul 11, 2023
👋 Hello and thanks for pinging us! This issue or PR has been added to our inbox and a Design Infrastructure first responder will review it soon.
|
lukasoppermann
commented
Aug 14, 2023
I'd love for @keithamus to approve this as he is working on it. Fine from primer FR side |
keithamus
commented
Aug 16, 2023
Thanks, I'm looking into fixing this but I have higher priorities for now. A fix will come though! |
joshblack
commented
Dec 12, 2024
Sorry for the delay on my end, adding this to the first responder board to pick up 👀 @keithamus just wanted to check-in, what are the next steps for this? |
camertron
commented
Dec 13, 2024
I looked into this today and have become thoroughly confused. Are you specifying any If I try copy/pasting your test cases into example/index.html, it always gives me something like "1 year, 6 days, 4 minutes, 24 seconds." I don't understand why the tests fail the way they do when no |
TymekDev
commented
Dec 13, 2024
@camertron according to the README the precision defaults to I just put this into an HTML (using v4.4.4 via npm): <relative-timeformat="duration" datetime="1944-12-13"></relative-time>It showed "81 years, 2 months, 22 hours, 21 minutes, 45 seconds" for me. Even if I set the precision as high as |
francinelucca
commented
Aug 27, 2026
Thanks for opening this PR @TymekDev! sorry for lack of activity here. I've taken a look at the tests and looks like you're right, the code needs to be corrected. I don't want to get failing tests into main so I'm hoping we can land on a fix instead and then pull these in. I've dropped a comment in #262 (comment), hopefully we can work on this soon. Will leave this PR open until then. |
This PR adds cases for whole years and whole months to not have extra days, e.g. May (
2023-05-11T00:00:00.00) to July (2023-07-11T00:00:00.00) being2 monthsinstead of current2 months, 1 day.Related issue: #262