fix(core): Account age inaccuracy due to leap years#499
fix(core): Account age inaccuracy due to leap years#499spenserblack wants to merge 2 commits intolowlighter:masterfrom spenserblack:bugfix/date-diff
Conversation
By converting the diff to a date, the date since 1970 is calculated. The year of that date minus 1970 would then equal the number of years that have passed, taking leap years into account.
|
Closing to avoid spamming vercel |
|
Thanks for fixing this! However I think the (This way it makes it progress a little day-by-day instead of waiting a whole year) But I'm not sure what's the best way to solve this 🤔
Yeah that's ok. Testing metrics is quite hard because there are so many edges cases, and mocking apis and data is really tedious x) |
Oh, I see. I partially addressed the breakage in #501, but I failed to make it increase in daily with this method. |
By converting the diff to a date, the date since 1970 is calculated. The
year of that date minus 1970 would then equal the number of years that
have passed, taking leap years into account.
Resolves #497
As a side note, I wanted to write tests for this, but making all the computed values of the core plugin testable would require a lot of refactoring, it seems.