relative-time-element
relative-time-element copied to clipboard
Web component extensions to the standard <time> element.
``` ``` Is displayed as > 11 years ago Relative to today, which is 6 Feb 2025 Is this correct? --- _https://www.timeanddate.com/date/durationresult.html?d1=14&m1=2&y1=2015&d2=6&m2=2&y2=2025_ From and including: Saturday, 14 February 2015 To,...
I'm planning to use this on my astro project but the suggested implementation doesnt work, astro wont render any formated date at all. Still getting the default April 1. I...
(This is part of a set of multiple pull requests looking to overhaul the calculation functions.) This pull request adds a new `relativeTime` function that directly takes two date values...
(This is part of a set of multiple pull requests looking to overhaul the calculation functions.) The current implementation of `elapsedTime` just assumes there are 30 days in a month,...
(This is part of a set of multiple pull requests looking to overhaul the calculation functions.) This pull request reimplements the `roundToSingleUnit` function with more robust logic. The original date...
Export the duration module, allowing the utility to be used without the HTML element. My current workaround is to have this in a package.json `postinstall` script ```sh TARGET=node_modules/@github/relative-time-element/package.json cat
Fixes: https://github.com/github/relative-time-element/issues/276 In my testing on MacOS, neither Chrome, Safari or Firefox did follow the OS's "24-hour time" setting, so from what I gather, browsers seem to try to determine...
Now, part of the check for determining if we should display user time preferences will also check for whether there is a specific attribute on the element, `disable-preference-override`. If this...
These changes enable the `` element to support user-supplied thresholds that pull from the value of a newly defined `data-preferred-threshold` attribute. The distinction between this feature and the pre-existing `threshold`...