Relative Time Element
Translation ManagementOpen Source Developer Tools

Relative Time Element

Formats a timestamp as a localized string or as relative text that auto-updates in the user's browser.

Open Source

About

The relative-time-element is a web component that formats timestamps as either localized strings or relative time text that updates in real-time within the user's browser. It allows for server-side caching of HTML fragments containing dates, while the browser handles localization based on user preferences. This component utilizes the Intl.DateTimeFormat and Intl.RelativeTimeFormat APIs, ensuring compatibility with modern JavaScript engines.

Open Source Health

Not enough history
Stars
4,033
Forks
192
License
MIT
Last commit
28 days ago
JavaScript

Related Categories