github/relative-time-element
Web component extensions to the standard <time> element.
Build with Backblaze B2
SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.
Loading star history...
Where it stands
Rank, growth pace and release cadence relative to everything GStars tracks.
No releases in the last 90 days; the most recent was 93 days ago, with 67 contributors on GitHub.
Gained 9% more stars in the last 90 days than in the 90 days before.
Use Cases & Benefits
- Formats timestamps as localized or relative time strings that auto-update in the browser using a custom web component.
- Enables server-side caching of static date markup while localizing and updating time display dynamically per user locale and timezone.
- Use for displaying user-friendly relative timestamps in web apps that respect user locale and timezone preferences.
- Use for embedding accessible, auto-updating time elements in static HTML content served from caches or CDNs.
- Use for building internationalized UI components that require precise control over date/time formatting and relative time thresholds.
Should you depend on it?
License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.
License
MIT
Permissive: commercial use, modification and redistribution are allowed with attribution.
Community files
- README: present
- Contributing guide: present
- Code of conduct: present
Watch-outs
No watch-outs from GStars' checks.
General guidance from repository metadata, not legal advice. How we score
From the README
Formats a timestamp as a localized string or as relative text that auto-updates in the user's browser.
This allows the server to cache HTML fragments containing dates and lets the browser choose how to localize the displayed time according to the user's preferences. For example, the server may have cached the following generated markup:
Every visitor is served the same markup from the server's cache. When it reaches the browser, the custom
relative-timeJavaScript localizes the element's text into the local timezone and formatting.Dates are displayed before months, and a 24-hour clock is used, according to the user's browser settings.
If the browser's JavaScript is disabled, the default text served in the cached markup is still displayed.
Available on npm as @github/relative-time-element.
This element uses the
Intl.DateTimeFormat&Intl.RelativeTimeFormatAPIs, which are supported by all modern JS engines. If you need to support an older browser, you may need to introduce a polyfill forIntl.DateTimeFormat&Intl.RelativeTimeFormat.Add a
<relative-time>element to your markup. Provide a default formatted date as the element's text content (e.g. April 1, 2014). It also MUST have adatetimeattribute set to an ISO 8601 formatted timestamp.Depending on how far in the future this is being viewed, the element's text will be replaced with one of the following formats:
So, a relative date phrase is used for up to a month and then the actual date is shown.
Daily snapshots
Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots
Forks
198+7
Open issues
23-1
Compared with peers in Frontend
Fastest-growing repositories GStars tracks in this cohort for the week of Nov 1, by 7-day star growth
| Repository | Stars | +7d | Health | Last release |
|---|---|---|---|---|
| Leonxlnx/taste-skill | 110.7K | +5.2K | 55 | 1 day ago |
| heygen-com/hyperframes | 79.6K | +4.1K | 45 | today |
| DuarteSantos8/openGym | 19.7K | +2.4K | 60 | 2 days ago |
| remotion-dev/remotion | 71.1K | +2.2K | 45 | today |
| chthollyphile/folia-major | 11.7K | +1.5K | 40 | today |
| github/relative-time-element | 4.0K | — | 60 | 93 days ago |
| Category median | 71.1K | +2.4K | 45 | — |
Also by github
Other repositories from this maintainer that GStars tracks
- Python147.9K stars
spec-kit
💫 Toolkit to help you get started with SDD or any other process!
- JavaScript40.8K stars
awesome-copilot
Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.
- Go34.3K stars
github-mcp-server
GitHub's official MCP Server
- TypeScript21.3K stars
docs
The open-source repo for docs.github.com
- Python11.4K stars
copilot-cli
GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal.
Discover Repositories
Search across tracked repositories by name or description