github / relative-time-element

Web component extensions to the standard <time> element.
https://github.github.io/relative-time-element/examples/
MIT License
3.57k stars 170 forks source link

tweak rounding rules for months #249

Closed keithamus closed 1 year ago

keithamus commented 1 year ago

Following on from #245 which updated rounding rules for calendar years, this PR updates the rounding rules for calendar months and days. It uses the real calendar to determine how the days & months should be calculated, rather than a simpler rounding heuristic.

Currently on GitHub, timestamps from early Jan are marked as "last year" due to imprecise rounding. This will fix that. Closes #248