awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
github avatar

github/relative-time-element

0
View on GitHub↗
4,005 stars·188 forks·JavaScript·MIT·10 viewsgithub.github.io/relative-time-element/examples↗

Relative Time Element

This project provides a web component time element that extends the standard HTML time tag to display human-readable relative timestamps and countdowns. It functions as a relative time formatter and time duration calculator, converting timestamps into localized strings that update automatically in the browser.

The tool enables dynamic timestamp displays that transition from relative phrases to absolute dates based on configurable time thresholds. It includes capabilities for date tense restriction, forcing timestamps to display exclusively as past or future dates, and supports precise duration formatting across years, months, days, hours, minutes, and seconds.

The implementation leverages the native browser Internationalization API for date rendering and localization across specific IANA time zones. It manages state through DOM attributes and utilizes interval polling to ensure time displays remain current without requiring a page refresh.

Features

  • Dynamic Relative Time Updaters - Provides a web component that automatically refreshes relative time labels like two hours ago.
  • Relative Time Formatting - Provides a web component that converts timestamps into localized relative strings that update automatically in the browser.
  • Duration Calculations - Provides utilities to calculate the elapsed or remaining time between timestamps for countdowns.
  • Human-Readable Duration Breakdown - Breaks down elapsed or remaining time into exact years, months, days, hours, minutes, and seconds.
  • Semantic Time Elements - Extends the standard HTML time tag to create a specialized element for human-readable relative timestamps and countdowns.
  • Countdown Timers - Calculates and displays the remaining time until a future event in detailed calendar units.
  • Internationalization API Integrations - Leverages the native browser Internationalization API for locale-aware date and relative time formatting.
  • Custom Element Wrappers - Provides a custom element wrapper that adds reactive behavior to the standard HTML time tag.
  • Web Components - Implements a reusable, modular custom HTML element based on the Web Components standard for time displays.
  • Format Transition Thresholds - Switches a date display from a relative phrase to a full absolute date once a specific time threshold is met.
  • Relative-to-Absolute Format Toggling - Sets a time threshold that switches a timestamp from a relative phrase to a full absolute date.
  • Date Localizations - Displays timestamps as localized date and time strings utilizing specific IANA time zones.
  • Temporal Threshold Rendering - Switches between relative phrasing and absolute date strings based on a configurable time difference limit.
  • Attribute-Driven State Synchronization - Implements state synchronization between DOM attributes and internal time calculations to enable reactive updates.
  • Date and Time Formatting - Adjusts date and time formatting based on browser locale settings and IANA time zones.
  • Asynchronous Polling Timers - Uses asynchronous polling timers to periodically refresh relative time displays without page reloads.

Star history

Star history chart for github/relative-time-elementStar history chart for github/relative-time-element

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Relative Time Element

Similar open-source projects, ranked by how many features they share with Relative Time Element.
  • hustcc/timeago.jshustcc avatar

    hustcc/timeago.js

    5,376View on GitHub↗

    timeago.js is a JavaScript library that converts timestamps into human-readable relative time strings. It functions as an internationalized date library that transforms static date and time data into descriptive statements of elapsed time. The project provides a dynamic time updater that automatically refreshes relative time labels on a webpage at regular intervals. It supports multilingual date localization, allowing time-elapsed statements to be translated into various languages using built-in or custom locale settings.

    TypeScript
    View on GitHub↗5,376
  • sdispater/pendulumsdispater avatar

    sdispater/pendulum

    6,668View on GitHub↗

    Pendulum is a Python date and time library that provides a simplified interface for date arithmetic, ISO parsing, localization, and timezone management. It serves as a replacement for the standard library datetime module, extending existing classes to maintain compatibility while offering a more intuitive management interface. The library distinguishes itself through a natural language date formatter that translates time differences into localized strings and a dedicated ISO 8601 date parser. It also includes tools for time-dependent logic testing, allowing the system clock to be mocked or fi

    Python
    View on GitHub↗6,668
  • dromara/carbondromara avatar

    dromara/carbon

    5,221View on GitHub↗

    Carbon is a Go library for semantic date and time calculations, formatting, and parsing. It provides a semantic interface to simplify temporal data handling and improve the readability of date and time manipulations. The library is distinguished by its support for multi-calendar date conversion, allowing transformations between Gregorian, Chinese Lunar, Persian, and Hebrew calendar systems. It also includes a localized temporal framework that uses ISO 639-1 codes to format dates and relative time differences across multiple language locales. Additional capabilities cover global time zone man

    Go
    View on GitHub↗5,221
  • rmm5t/jquery-timeagormm5t avatar

    rmm5t/jquery-timeago

    3,800View on GitHub↗

    This library is a client-side tool designed to transform static date strings into automatically updating, human-readable relative time labels within web interfaces. It functions as a plugin that scans the document for specific elements and converts their content into dynamic expressions, such as minutes or hours ago, to provide context for recent activity. The system distinguishes itself by decoupling display logic from JavaScript through attribute-driven configuration, allowing settings and date values to be managed directly within HTML. It maintains accuracy by employing interval-based poll

    JavaScript
    View on GitHub↗3,800
See all 30 alternatives to Relative Time Element→

Frequently asked questions

What does github/relative-time-element do?

This project provides a web component time element that extends the standard HTML time tag to display human-readable relative timestamps and countdowns. It functions as a relative time formatter and time duration calculator, converting timestamps into localized strings that update automatically in the browser.

What are the main features of github/relative-time-element?

The main features of github/relative-time-element are: Dynamic Relative Time Updaters, Relative Time Formatting, Duration Calculations, Human-Readable Duration Breakdown, Semantic Time Elements, Countdown Timers, Internationalization API Integrations, Custom Element Wrappers.

What are some open-source alternatives to github/relative-time-element?

Open-source alternatives to github/relative-time-element include: hustcc/timeago.js — timeago.js is a JavaScript library that converts timestamps into human-readable relative time strings. It functions as… sdispater/pendulum — Pendulum is a Python date and time library that provides a simplified interface for date arithmetic, ISO parsing,… dromara/carbon — Carbon is a Go library for semantic date and time calculations, formatting, and parsing. It provides a semantic… rmm5t/jquery-timeago — This library is a client-side tool designed to transform static date strings into automatically updating,… muxinc/media-chrome — Media Chrome is a library of modular, accessible web components designed for building custom audio and video player… tc39/proposal-temporal — This project is a proposal for a new immutable date and time API in JavaScript. It serves as a precision time-tracking…