github / relative-time-element

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

Display text wrong #288

Closed Leo01234 closed 1 month ago

Leo01234 commented 1 month ago

It should be something like "1 month ago", but it writes "yesterday".

Edit:

I just notice #281, but it seems not fixed.

keithamus commented 1 month ago

Can you please make a PR with a failing test? We have a bunch of tests in a file that look like this:

https://github.com/github/relative-time-element/blob/15ca61e1992f39f242aa4de0b35c14ce76062990/test/relative-time.js#L1806-L1812

If you copy that object and add a new one right below it with the values tweaked (reference set to todays date, datetime set to the datetime attribute on the failing instance) to represent the expected output, and we can see if it fails. If it does fail we can look at a fix.

aprendendofelipe commented 1 month ago

It's not a problem with relative-time-element. GitHub is not using version 4.4.2 yet.

See https://github.com/primer/react/pull/4803