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. Every visitor is served the same markup from the server's cache. When it reaches the browser, the custom relative-time JavaScript 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.
Features
- Web component extensions to the standard <time> element
- Documentation available
- Examples available
- Browser Support
- Browsers without native custom element support require a polyfill
- Relative text that auto-updates in the user's browser
Categories
Localization (L10N)License
MIT LicenseFollow Relative-Time Element
Other Useful Business Software
MongoDB Atlas runs apps anywhere
MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of Relative-Time Element!