A tiny JavaScript library for formatting dates into human-readable 'time ago' statements.
timeago.js is a lightweight JavaScript library that formats dates into human-readable relative time strings like '3 hours ago' or 'in 2 days'. It solves the problem of displaying timestamps in a user-friendly, localized manner without heavy dependencies. The library is designed to be simple, efficient, and easily integrated into both browser and Node.js applications.
Frontend and full-stack developers who need to display relative timestamps in web applications, blogs, social media feeds, or dashboards. It's particularly useful for projects requiring real-time updates and internationalization.
Developers choose timeago.js for its minimal size (under 2 KB), ease of use, and built-in i18n support. Unlike larger date libraries, it focuses solely on relative time formatting, offering a straightforward API with real-time rendering capabilities and no external dependencies.
:clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with *** time ago statement.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
At less than 2 KB minified, it has minimal impact on bundle size, crucial for fast-loading web applications as highlighted in the README's feature list.
The render function automatically refreshes time strings at configurable intervals, ideal for dynamic content like chat apps or live feeds without manual coding.
Built-in support for locales and a simple register API allow quick adaptation for global audiences, with examples provided for custom language definitions.
With only four core functions (format, render, cancel, register), it's easy to learn and integrate, reducing cognitive overhead for developers.
Only English (en_US) and Chinese (zh_CN) are included by default; adding other languages requires manual registration, which can be tedious and error-prone.
It solely formats relative time, so for parsing, timezone handling, or other date operations, you must integrate a separate library, increasing complexity.
The automatic updates can cause unnecessary DOM manipulations if not managed carefully, especially with many elements, leading to potential performance hits.