Hy Lạpihym/ngx-timeago
⏰ Live updating timestamps in Angular
⏰ Thời gian sống động cho ứng dụng Angular
Pipe
timeagovà 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 địnhtrue) tự động làm mới thời gian. - Hỗ trợ i18n: nhập chuỗi ngôn ngữ từ
jquery-timeagocho 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ặcTimeagoModule.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.
:clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with `*** time ago` statement.
Angular testing library for mocking components, directives, pipes, services and facilitating TestBed setup
An Angular pipe for converting a date string into a time ago
Reverse engineer anything with agents, from app behavior down to native binaries.
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.
Interactive roadmaps, guides and other educational content to help developers grow in their careers.
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.
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.