RepositoryTypeScriptGRHy Lạp
ihym

ihym/ngx-timeago

⏰ Live updating timestamps in Angular

80sao
14fork
2issue
3lượt xem

⏰ Thời gian sống động cho ứng dụng Angular

Pipe timeago và directive tự động cập nhật thời gian thực trong Angular.

ngx-timeago là thư viện Angular hiển thị nhãn thời gian theo định dạng "X thời gian trước" (ví dụ: "vừa xong", "5 phút trước"). Hỗ trợ cập nhật sống động, đa ngôn ngữ và cấu hình tùy biến hoàn toàn.

✨ Điểm nổi bật

  • Pipe timeago: {{ date | timeago }} hiển thị thời gian tính đến thời điểm hiện tại.
  • Directive timeago: <div timeago [date]="date"> áp dụng trực tiếp vào template.
  • Cập nhật sống động: tùy chọn live (mặc định true) tự động làm mới thời gian.
  • Hỗ trợ i18n: nhập chuỗi ngôn ngữ từ jquery-timeago cho nhiều ngôn ngữ.
  • Formatter tùy biến: kế thừa TimeagoFormatter để điều khiển định dạng hiển thị.
  • Clock tùy biến: kế thừa TimeagoClock để thiết lập tần suất cập nhật.
  • Hỗ trợ standalone và NgModule: cấu hình qua provideTimeago() hoặc TimeagoModule.forRoot().
  • Tương thích đa phiên bản Angular: hỗ trợ Angular 6 đến 20.

💡 Vì sao đáng chú ý

Khác với cách tính toán thời gian tĩnh một lần khi render, ngx-timeago liên tục cập nhật nhãn thời gian theo thời gian thực, giúp giao diện luôn mới và tự nhiên. Phù hợp cho ứng dụng yêu cầu hiển thị thời gian động như xã hội, nhật ký hoạt động, hoặc bất kỳ nơi người dùng cần biết mốc thời gian gần đây.


#Angular #Timeago #Timestamp #I18n #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryTypeScript
hustcc/timeago.js

:clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with `*** time ago` statement.

5.4k
Nov 25, 2026
RepositoryTypeScript
help-me-mom/ng-mocks

Angular testing library for mocking components, directives, pipes, services and facilitating TestBed setup

1.2k
Nov 25, 2026
RepositoryTypeScript
AndrewPoyntz/time-ago-pipe

An Angular pipe for converting a date string into a time ago

127
Jan 11, 2023
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026
RepositoryTypeScript
nilbuild/developer-roadmap

Interactive roadmaps, guides and other educational content to help developers grow in their careers.

373.1k
Dec 1, 2026
RepositoryTypeScript
firecrawl/firecrawl

Firecrawl is the knowledge infrastructure to make your agents smarter. It connects your agents to the web, and to Alexandria, our library of everything else.

215.1k
Dec 2, 2026
RepositoryTypeScript
vuejs/vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

212.6k
Oct 10, 2024
RepositoryPython
donnemartin/system-design-primer

Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.

379.9k
Sep 15, 2026